From xen-changelog-bounces@lists.xen.org Fri Jul 03 09:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2015 09:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZAxLK-0002Wl-Au; Fri, 03 Jul 2015 09:33:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLI-0002Wd-Fx
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:08 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	EE/19-18733-3D656955; Fri, 03 Jul 2015 09:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1435915985!28954173!1
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 896 invoked from network); 3 Jul 2015 09:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jul 2015 09:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLC-0002Rz-UL
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLC-0007JV-Bk
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:02 +0000
Date: Fri, 03 Jul 2015 09:33:02 +0000
Message-Id: <E1ZAxLC-0007JV-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Accept %z in printf formats
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6e91f5c2fac25d5f497efa70e7ffb7bdf4987b0
Author:     Thomas Leonard <talex5@gmail.com>
AuthorDate: Wed Jul 1 10:24:50 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 3 10:14:55 2015 +0100

    Accept %z in printf formats
    
    Before, we only supported %Z (upper-case). It seems that the lower-case
    version is standard, and this matches the behaviour of Xen's vsprintf.c.
    
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/printf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/printf.c b/lib/printf.c
index 3d02e95..40f92fc 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -346,12 +346,14 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 
         /* get the conversion qualifier */
         qualifier = -1;
-        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
+        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z' || *fmt == 'z') {
             qualifier = *fmt;
             ++fmt;
             if (qualifier == 'l' && *fmt == 'l') {
                 qualifier = 'L';
                 ++fmt;
+            } else if (qualifier == 'z') {
+                qualifier = 'Z';
             }
         }
         if (*fmt == 'q') {
--
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 Fri Jul 03 09:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2015 09:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZAxLK-0002Wl-Au; Fri, 03 Jul 2015 09:33:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLI-0002Wd-Fx
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:08 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	EE/19-18733-3D656955; Fri, 03 Jul 2015 09:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1435915985!28954173!1
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 896 invoked from network); 3 Jul 2015 09:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jul 2015 09:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLC-0002Rz-UL
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLC-0007JV-Bk
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:02 +0000
Date: Fri, 03 Jul 2015 09:33:02 +0000
Message-Id: <E1ZAxLC-0007JV-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Accept %z in printf formats
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6e91f5c2fac25d5f497efa70e7ffb7bdf4987b0
Author:     Thomas Leonard <talex5@gmail.com>
AuthorDate: Wed Jul 1 10:24:50 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 3 10:14:55 2015 +0100

    Accept %z in printf formats
    
    Before, we only supported %Z (upper-case). It seems that the lower-case
    version is standard, and this matches the behaviour of Xen's vsprintf.c.
    
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/printf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/printf.c b/lib/printf.c
index 3d02e95..40f92fc 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -346,12 +346,14 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 
         /* get the conversion qualifier */
         qualifier = -1;
-        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
+        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z' || *fmt == 'z') {
             qualifier = *fmt;
             ++fmt;
             if (qualifier == 'l' && *fmt == 'l') {
                 qualifier = 'L';
                 ++fmt;
+            } else if (qualifier == 'z') {
+                qualifier = 'Z';
             }
         }
         if (*fmt == 'q') {
--
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 Fri Jul 03 09:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2015 09:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZAxLU-0002XS-DV; Fri, 03 Jul 2015 09:33: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 1ZAxLS-0002XG-FU
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:18 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	BF/8A-03035-DD656955; Fri, 03 Jul 2015 09:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1435915995!22371377!1
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 27248 invoked from network); 3 Jul 2015 09:33:16 -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;
	3 Jul 2015 09:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLP-0002S3-Pf
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLP-0007Jz-KJ
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:15 +0000
Date: Fri, 03 Jul 2015 09:33:15 +0000
Message-Id: <E1ZAxLP-0007Jz-KJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Correct printf formatting for
	tpm_tis message.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b36bcb370d611ad7f41e8c21d061e6291e088c58
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jun 26 11:58:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 3 10:23:16 2015 +0100

    Correct printf formatting for tpm_tis message.
    
    This is under #ifdef HAVE_LIBC so went unnoticed before.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 tpm_tis.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tpm_tis.c b/tpm_tis.c
index 98fe837..475ac5d 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1429,7 +1429,7 @@ struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned
 
             /* Map the page in now */
             if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-                printk("Unable to map iomem page a address %p\n", addr);
+                printk("Unable to map iomem page a address %lx\n", addr);
                 goto abort_egress;
             }
 
--
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 Fri Jul 03 09:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2015 09:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZAxLU-0002XS-DV; Fri, 03 Jul 2015 09:33: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 1ZAxLS-0002XG-FU
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:18 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	BF/8A-03035-DD656955; Fri, 03 Jul 2015 09:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1435915995!22371377!1
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 27248 invoked from network); 3 Jul 2015 09:33:16 -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;
	3 Jul 2015 09:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLP-0002S3-Pf
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZAxLP-0007Jz-KJ
	for xen-changelog@lists.xensource.com; Fri, 03 Jul 2015 09:33:15 +0000
Date: Fri, 03 Jul 2015 09:33:15 +0000
Message-Id: <E1ZAxLP-0007Jz-KJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Correct printf formatting for
	tpm_tis message.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b36bcb370d611ad7f41e8c21d061e6291e088c58
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jun 26 11:58:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 3 10:23:16 2015 +0100

    Correct printf formatting for tpm_tis message.
    
    This is under #ifdef HAVE_LIBC so went unnoticed before.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 tpm_tis.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tpm_tis.c b/tpm_tis.c
index 98fe837..475ac5d 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1429,7 +1429,7 @@ struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned
 
             /* Map the page in now */
             if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-                printk("Unable to map iomem page a address %p\n", addr);
+                printk("Unable to map iomem page a address %lx\n", addr);
                 goto abort_egress;
             }
 
--
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 Fri Jul 10 07:11:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2015 07:11: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 1ZDSSh-0004WR-3t; Fri, 10 Jul 2015 07:11: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 1ZDSSf-0004WM-MT
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:05 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	37/AD-06739-9007F955; Fri, 10 Jul 2015 07:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1436512263!23296199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13349 invoked from network); 10 Jul 2015 07:11:04 -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;
	10 Jul 2015 07:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZDSSd-0007Mb-0w
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZDSSc-0000sN-GR
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:02 +0000
Date: Fri, 10 Jul 2015 07:11:02 +0000
Message-Id: <E1ZDSSc-0000sN-GR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] update Xen version to 4.4.3-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36c53c22cd72f742cb42891354e82e9532436fcf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 9 14:22:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 9 14:22:08 2015 +0200

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

diff --git a/Config.mk b/Config.mk
index 1cbc2cf..96f7a62 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
@@ -246,7 +246,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= fd5c04144e204539f04e2f7994b12eef7724c31a
+QEMU_TAG ?= xen-4.4.3-rc1
 # Sun May 24 10:53:44 2015 +0200
 # pcnet: force the buffer access to be in bounds during tx
 
diff --git a/xen/Makefile b/xen/Makefile
index be8e1a2..b26ff5b 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    = 4
-export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-rc1$(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.4

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

From xen-changelog-bounces@lists.xen.org Fri Jul 10 07:11:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2015 07:11: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 1ZDSSh-0004WR-3t; Fri, 10 Jul 2015 07:11: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 1ZDSSf-0004WM-MT
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:05 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	37/AD-06739-9007F955; Fri, 10 Jul 2015 07:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1436512263!23296199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13349 invoked from network); 10 Jul 2015 07:11:04 -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;
	10 Jul 2015 07:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZDSSd-0007Mb-0w
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZDSSc-0000sN-GR
	for xen-changelog@lists.xensource.com; Fri, 10 Jul 2015 07:11:02 +0000
Date: Fri, 10 Jul 2015 07:11:02 +0000
Message-Id: <E1ZDSSc-0000sN-GR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] update Xen version to 4.4.3-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36c53c22cd72f742cb42891354e82e9532436fcf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 9 14:22:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 9 14:22:08 2015 +0200

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

diff --git a/Config.mk b/Config.mk
index 1cbc2cf..96f7a62 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
@@ -246,7 +246,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= fd5c04144e204539f04e2f7994b12eef7724c31a
+QEMU_TAG ?= xen-4.4.3-rc1
 # Sun May 24 10:53:44 2015 +0200
 # pcnet: force the buffer access to be in bounds during tx
 
diff --git a/xen/Makefile b/xen/Makefile
index be8e1a2..b26ff5b 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    = 4
-export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-rc1$(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.4

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

From xen-changelog-bounces@lists.xen.org Tue Jul 14 15:22:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF222-0003Ww-N6; Tue, 14 Jul 2015 15:22: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 1ZF221-0003Wi-EA
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:05 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	02/48-23832-C1925A55; Tue, 14 Jul 2015 15:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1436887323!24473005!1
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 19918 invoked from network); 14 Jul 2015 15:22:04 -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;
	14 Jul 2015 15:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF21z-0003o0-2Y
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF21y-0004on-Pn
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:02 +0000
Date: Tue, 14 Jul 2015 15:22:02 +0000
Message-Id: <E1ZF21y-0004on-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/traps: identify the vcpu in
	context when dumping 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 c4d7b91c759b542ad55802d92974948e89160809
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:50:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:50:09 2015 +0200

    x86/traps: identify the vcpu in context when dumping registers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e59abf8c8c9c1d99a531292c6a548d6dfd0ceacc
    master date: 2015-04-14 14:59:53 +0200
---
 xen/arch/x86/x86_64/traps.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 0040bef..8a4b584 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -53,9 +53,11 @@ static void _show_registers(
     printk("\nRFLAGS: %016lx   ", regs->rflags);
     if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
         printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
-    printk("CONTEXT: %s\n", context_names[context]);
+    printk("CONTEXT: %s", context_names[context]);
+    if ( v && !is_idle_vcpu(v) )
+        printk(" (%pv)", v);
 
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
+    printk("\nrax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
            regs->rdx, regs->rsi, regs->rdi);
--
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 Jul 14 15:22:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF222-0003Ww-N6; Tue, 14 Jul 2015 15:22: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 1ZF221-0003Wi-EA
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:05 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	02/48-23832-C1925A55; Tue, 14 Jul 2015 15:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1436887323!24473005!1
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 19918 invoked from network); 14 Jul 2015 15:22:04 -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;
	14 Jul 2015 15:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF21z-0003o0-2Y
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF21y-0004on-Pn
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:02 +0000
Date: Tue, 14 Jul 2015 15:22:02 +0000
Message-Id: <E1ZF21y-0004on-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/traps: identify the vcpu in
	context when dumping 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 c4d7b91c759b542ad55802d92974948e89160809
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:50:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:50:09 2015 +0200

    x86/traps: identify the vcpu in context when dumping registers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e59abf8c8c9c1d99a531292c6a548d6dfd0ceacc
    master date: 2015-04-14 14:59:53 +0200
---
 xen/arch/x86/x86_64/traps.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 0040bef..8a4b584 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -53,9 +53,11 @@ static void _show_registers(
     printk("\nRFLAGS: %016lx   ", regs->rflags);
     if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
         printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
-    printk("CONTEXT: %s\n", context_names[context]);
+    printk("CONTEXT: %s", context_names[context]);
+    if ( v && !is_idle_vcpu(v) )
+        printk(" (%pv)", v);
 
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
+    printk("\nrax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
            regs->rdx, regs->rsi, regs->rdi);
--
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 Jul 14 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22D-0003Ya-Ph; Tue, 14 Jul 2015 15:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22C-0003YN-Fj
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:16 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	0C/86-03949-72925A55; Tue, 14 Jul 2015 15:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1436887334!13522237!1
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 2452 invoked from network); 14 Jul 2015 15:22:15 -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;
	14 Jul 2015 15:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF229-0003o5-8h
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF229-0004pj-6f
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:13 +0000
Date: Tue, 14 Jul 2015 15:22:13 +0000
Message-Id: <E1ZF229-0004pj-6f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] passthrough/amd: avoid reading an
	uninitialized variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e7e487f8838e7aba61ac953e88bd442d8a016c4
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Jul 13 13:51:10 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:51:10 2015 +0200

    passthrough/amd: avoid reading an uninitialized variable
    
    update_intremap_entry_from_msi() doesn't write to its data pointer on
    some error paths, so we copying that variable into the msg would count
    as undefined behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: a8ccf2d9f6f291f8fc6003e3d8bc7275ac1cc69f
    master date: 2015-04-24 12:04:57 +0200
---
 xen/drivers/passthrough/amd/iommu_intr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 18d8b5f..d3f3725 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -531,10 +531,12 @@ int amd_iommu_msi_msg_update_ire(
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
 
     if ( !rc )
+    {
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
+        msg->data = data;
+    }
 
-    msg->data = data;
     return rc;
 }
 
--
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 Jul 14 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22D-0003Ya-Ph; Tue, 14 Jul 2015 15:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22C-0003YN-Fj
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:16 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	0C/86-03949-72925A55; Tue, 14 Jul 2015 15:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1436887334!13522237!1
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 2452 invoked from network); 14 Jul 2015 15:22:15 -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;
	14 Jul 2015 15:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF229-0003o5-8h
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF229-0004pj-6f
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:13 +0000
Date: Tue, 14 Jul 2015 15:22:13 +0000
Message-Id: <E1ZF229-0004pj-6f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] passthrough/amd: avoid reading an
	uninitialized variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e7e487f8838e7aba61ac953e88bd442d8a016c4
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Jul 13 13:51:10 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:51:10 2015 +0200

    passthrough/amd: avoid reading an uninitialized variable
    
    update_intremap_entry_from_msi() doesn't write to its data pointer on
    some error paths, so we copying that variable into the msg would count
    as undefined behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: a8ccf2d9f6f291f8fc6003e3d8bc7275ac1cc69f
    master date: 2015-04-24 12:04:57 +0200
---
 xen/drivers/passthrough/amd/iommu_intr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 18d8b5f..d3f3725 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -531,10 +531,12 @@ int amd_iommu_msi_msg_update_ire(
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
 
     if ( !rc )
+    {
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
+        msg->data = data;
+    }
 
-    msg->data = data;
     return rc;
 }
 
--
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 Jul 14 15:22:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22N-0003a6-SI; Tue, 14 Jul 2015 15:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22M-0003Zv-C5
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:26 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	7B/2B-22118-13925A55; Tue, 14 Jul 2015 15:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1436887343!15685811!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 16513 invoked from network); 14 Jul 2015 15:22:24 -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;
	14 Jul 2015 15:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22J-0003oG-Kf
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22J-0004q6-CJ
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:23 +0000
Date: Tue, 14 Jul 2015 15:22:23 +0000
Message-Id: <E1ZF22J-0004q6-CJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/debugger: use
	copy_to/from_guest() in dbg_rw_guest_mem()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b92d57157dbd2ba7b152563a4aa73665ac3c70fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:51:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:51:48 2015 +0200

    x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()
    
    Using gdbsx on Broadwell systems suffers a SMAP violation because
    dbg_rw_guest_mem() uses memcpy() with a userspace pointer.
    
    The functions dbg_rw_mem() and dbg_rw_guest_mem() have been updated to pass
    'void * __user' pointers which indicates their nature clearly.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 229492e210ae86e35f4af0cfb3f2b98e8e946e04
    master date: 2015-06-03 09:27:09 +0200
---
 xen/arch/x86/debug.c           |   45 +++++++++++++++++++++++----------------
 xen/arch/x86/domctl.c          |   16 +++++++-------
 xen/include/asm-x86/debugger.h |    7 ++---
 3 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 435bd40..801dcf2 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -41,6 +41,9 @@
 #define DBGP2(...) ((void)0)
 #endif
 
+typedef unsigned long dbgva_t;
+typedef unsigned char dbgbyte_t;
+
 /* Returns: mfn for the given (hvm guest) vaddr */
 static unsigned long 
 dbg_hvm_va2mfn(dbgva_t vaddr, struct domain *dp, int toaddr,
@@ -154,13 +157,14 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t pgd3val)
 }
 
 /* Returns: number of bytes remaining to be copied */
-static int
-dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp, 
-                 int toaddr, uint64_t pgd3)
+unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
+                              void * __user buf, unsigned int len,
+                              bool_t toaddr, uint64_t pgd3)
 {
     while ( len > 0 )
     {
         char *va;
+        unsigned long addr = (unsigned long)gaddr;
         unsigned long mfn, gfn = INVALID_GFN, pagecnt;
 
         pagecnt = min_t(long, PAGE_SIZE - (addr & ~PAGE_MASK), len);
@@ -176,12 +180,12 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
 
         if ( toaddr )
         {
-            memcpy(va, buf, pagecnt);    /* va = buf */
+            copy_from_user(va, buf, pagecnt);    /* va = buf */
             paging_mark_dirty(dp, mfn);
         }
         else
         {
-            memcpy(buf, va, pagecnt);    /* buf = va */
+            copy_to_user(buf, va, pagecnt);    /* buf = va */
         }
 
         unmap_domain_page(va);
@@ -203,27 +207,30 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
  * pgd3: value of init_mm.pgd[3] in guest. see above.
  * Returns: number of bytes remaining to be copied. 
  */
-int
-dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len, domid_t domid, int toaddr,
-           uint64_t pgd3)
+unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
+                        unsigned int len, domid_t domid, bool_t toaddr,
+                        uint64_t pgd3)
 {
-    struct domain *dp = get_domain_by_id(domid);
-    int hyp = (domid == DOMID_IDLE);
+    DBGP2("gmem:addr:%lx buf:%p len:$%u domid:%d toaddr:%x\n",
+          addr, buf, len, domid, toaddr);
 
-    DBGP2("gmem:addr:%lx buf:%p len:$%d domid:%x toaddr:%x dp:%p\n", 
-          addr, buf, len, domid, toaddr, dp);
-    if ( hyp )
+    if ( domid == DOMID_IDLE )
     {
         if ( toaddr )
-            len = __copy_to_user((void *)addr, buf, len);
+            len = __copy_to_user(addr, buf, len);
         else
-            len = __copy_from_user(buf, (void *)addr, len);
+            len = __copy_from_user(buf, addr, len);
     }
-    else if ( dp )
+    else
     {
-        if ( !dp->is_dying )   /* make sure guest is still there */
-            len= dbg_rw_guest_mem(addr, buf, len, dp, toaddr, pgd3);
-        put_domain(dp);
+        struct domain *d = get_domain_by_id(domid);
+
+        if ( d )
+        {
+            if ( !d->is_dying )
+                len = dbg_rw_guest_mem(d, addr, buf, len, toaddr, pgd3);
+            put_domain(d);
+        }
     }
 
     DBGP2("gmem:exit:len:$%d\n", len);
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1585526..40fb3df 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -37,14 +37,14 @@
 #include <asm/debugger.h>
 #include <asm/psr.h>
 
-static int gdbsx_guest_mem_io(
-    domid_t domid, struct xen_domctl_gdbsx_memio *iop)
-{   
-    ulong l_uva = (ulong)iop->uva;
-    iop->remain = dbg_rw_mem(
-        (dbgva_t)iop->gva, (dbgbyte_t *)l_uva, iop->len, domid,
-        iop->gwr, iop->pgd3val);
-    return (iop->remain ? -EFAULT : 0);
+static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
+{
+    void * __user gva = (void *)iop->gva, * __user uva = (void *)iop->uva;
+
+    iop->remain = dbg_rw_mem(gva, uva, iop->len, domid,
+                             !!iop->gwr, iop->pgd3val);
+
+    return iop->remain ? -EFAULT : 0;
 }
 
 #define MAX_IOPORTS 0x10000
diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h
index 0408bec..33f4700 100644
--- a/xen/include/asm-x86/debugger.h
+++ b/xen/include/asm-x86/debugger.h
@@ -82,9 +82,8 @@ static inline int debugger_trap_entry(
     return 0;
 }
 
-typedef unsigned long dbgva_t;
-typedef unsigned char dbgbyte_t;
-extern int dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len,
-                      domid_t domid, int toaddr, uint64_t pgd3);
+unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
+                        unsigned int len, domid_t domid, bool_t toaddr,
+                        uint64_t pgd3);
 
 #endif /* __X86_DEBUGGER_H__ */
--
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 Jul 14 15:22:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22N-0003a6-SI; Tue, 14 Jul 2015 15:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22M-0003Zv-C5
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:26 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	7B/2B-22118-13925A55; Tue, 14 Jul 2015 15:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1436887343!15685811!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 16513 invoked from network); 14 Jul 2015 15:22:24 -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;
	14 Jul 2015 15:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22J-0003oG-Kf
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22J-0004q6-CJ
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:23 +0000
Date: Tue, 14 Jul 2015 15:22:23 +0000
Message-Id: <E1ZF22J-0004q6-CJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/debugger: use
	copy_to/from_guest() in dbg_rw_guest_mem()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b92d57157dbd2ba7b152563a4aa73665ac3c70fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:51:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:51:48 2015 +0200

    x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()
    
    Using gdbsx on Broadwell systems suffers a SMAP violation because
    dbg_rw_guest_mem() uses memcpy() with a userspace pointer.
    
    The functions dbg_rw_mem() and dbg_rw_guest_mem() have been updated to pass
    'void * __user' pointers which indicates their nature clearly.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 229492e210ae86e35f4af0cfb3f2b98e8e946e04
    master date: 2015-06-03 09:27:09 +0200
---
 xen/arch/x86/debug.c           |   45 +++++++++++++++++++++++----------------
 xen/arch/x86/domctl.c          |   16 +++++++-------
 xen/include/asm-x86/debugger.h |    7 ++---
 3 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 435bd40..801dcf2 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -41,6 +41,9 @@
 #define DBGP2(...) ((void)0)
 #endif
 
+typedef unsigned long dbgva_t;
+typedef unsigned char dbgbyte_t;
+
 /* Returns: mfn for the given (hvm guest) vaddr */
 static unsigned long 
 dbg_hvm_va2mfn(dbgva_t vaddr, struct domain *dp, int toaddr,
@@ -154,13 +157,14 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t pgd3val)
 }
 
 /* Returns: number of bytes remaining to be copied */
-static int
-dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp, 
-                 int toaddr, uint64_t pgd3)
+unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
+                              void * __user buf, unsigned int len,
+                              bool_t toaddr, uint64_t pgd3)
 {
     while ( len > 0 )
     {
         char *va;
+        unsigned long addr = (unsigned long)gaddr;
         unsigned long mfn, gfn = INVALID_GFN, pagecnt;
 
         pagecnt = min_t(long, PAGE_SIZE - (addr & ~PAGE_MASK), len);
@@ -176,12 +180,12 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
 
         if ( toaddr )
         {
-            memcpy(va, buf, pagecnt);    /* va = buf */
+            copy_from_user(va, buf, pagecnt);    /* va = buf */
             paging_mark_dirty(dp, mfn);
         }
         else
         {
-            memcpy(buf, va, pagecnt);    /* buf = va */
+            copy_to_user(buf, va, pagecnt);    /* buf = va */
         }
 
         unmap_domain_page(va);
@@ -203,27 +207,30 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
  * pgd3: value of init_mm.pgd[3] in guest. see above.
  * Returns: number of bytes remaining to be copied. 
  */
-int
-dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len, domid_t domid, int toaddr,
-           uint64_t pgd3)
+unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
+                        unsigned int len, domid_t domid, bool_t toaddr,
+                        uint64_t pgd3)
 {
-    struct domain *dp = get_domain_by_id(domid);
-    int hyp = (domid == DOMID_IDLE);
+    DBGP2("gmem:addr:%lx buf:%p len:$%u domid:%d toaddr:%x\n",
+          addr, buf, len, domid, toaddr);
 
-    DBGP2("gmem:addr:%lx buf:%p len:$%d domid:%x toaddr:%x dp:%p\n", 
-          addr, buf, len, domid, toaddr, dp);
-    if ( hyp )
+    if ( domid == DOMID_IDLE )
     {
         if ( toaddr )
-            len = __copy_to_user((void *)addr, buf, len);
+            len = __copy_to_user(addr, buf, len);
         else
-            len = __copy_from_user(buf, (void *)addr, len);
+            len = __copy_from_user(buf, addr, len);
     }
-    else if ( dp )
+    else
     {
-        if ( !dp->is_dying )   /* make sure guest is still there */
-            len= dbg_rw_guest_mem(addr, buf, len, dp, toaddr, pgd3);
-        put_domain(dp);
+        struct domain *d = get_domain_by_id(domid);
+
+        if ( d )
+        {
+            if ( !d->is_dying )
+                len = dbg_rw_guest_mem(d, addr, buf, len, toaddr, pgd3);
+            put_domain(d);
+        }
     }
 
     DBGP2("gmem:exit:len:$%d\n", len);
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1585526..40fb3df 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -37,14 +37,14 @@
 #include <asm/debugger.h>
 #include <asm/psr.h>
 
-static int gdbsx_guest_mem_io(
-    domid_t domid, struct xen_domctl_gdbsx_memio *iop)
-{   
-    ulong l_uva = (ulong)iop->uva;
-    iop->remain = dbg_rw_mem(
-        (dbgva_t)iop->gva, (dbgbyte_t *)l_uva, iop->len, domid,
-        iop->gwr, iop->pgd3val);
-    return (iop->remain ? -EFAULT : 0);
+static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
+{
+    void * __user gva = (void *)iop->gva, * __user uva = (void *)iop->uva;
+
+    iop->remain = dbg_rw_mem(gva, uva, iop->len, domid,
+                             !!iop->gwr, iop->pgd3val);
+
+    return iop->remain ? -EFAULT : 0;
 }
 
 #define MAX_IOPORTS 0x10000
diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h
index 0408bec..33f4700 100644
--- a/xen/include/asm-x86/debugger.h
+++ b/xen/include/asm-x86/debugger.h
@@ -82,9 +82,8 @@ static inline int debugger_trap_entry(
     return 0;
 }
 
-typedef unsigned long dbgva_t;
-typedef unsigned char dbgbyte_t;
-extern int dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len,
-                      domid_t domid, int toaddr, uint64_t pgd3);
+unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
+                        unsigned int len, domid_t domid, bool_t toaddr,
+                        uint64_t pgd3);
 
 #endif /* __X86_DEBUGGER_H__ */
--
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 Jul 14 15:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 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 1ZF22Z-0003bu-Uq; Tue, 14 Jul 2015 15:22:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22Y-0003bj-93
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:38 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	A0/17-22929-D3925A55; Tue, 14 Jul 2015 15:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1436887355!16974233!1
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 9028 invoked from network); 14 Jul 2015 15:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22T-0003oO-Pb
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22T-0004qb-Oc
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:33 +0000
Date: Tue, 14 Jul 2015 15:22:33 +0000
Message-Id: <E1ZF22T-0004qb-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] kexec: add more pages to v1
	environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b30aee44046f3989ca3c5a8d21cb961ad9da7266
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 13:52:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:52:27 2015 +0200

    kexec: add more pages to v1 environment
    
    Destination pages need mappings to be added to the page tables in the
    v1 case (where nothing else calls machine_kexec_add_page() for them).
    
    Further, without the tools mapping the low 1Mb (expected by at least
    some Linux version), we need to do so in the hypervisor in the v1 case.
    
    Suggested-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5cb57f4bddee1f11079e69bf43c193a8b104c476
    master date: 2015-06-09 16:00:24 +0200
---
 xen/common/kexec.c  |   18 ++++++++++++++++++
 xen/common/kimage.c |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 2239ee8..45954eb 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_load_v1_t *load, int compat)
     if ( ret < 0 )
         goto error;
 
+    if ( arch == EM_386 || arch == EM_X86_64 )
+    {
+        /*
+         * Ensure 0 - 1 MiB is mapped and accessible by the image.
+         *
+         * This allows access to VGA memory and the region purgatory copies
+         * in the crash case.
+         */
+        unsigned long addr;
+
+        for ( addr = 0; addr < MB(1); addr += PAGE_SIZE )
+        {
+            ret = machine_kexec_add_page(kimage, addr, addr);
+            if ( ret < 0 )
+                goto error;
+        }
+    }
+
     ret = kexec_load_slot(kimage);
     if ( ret < 0 )
         goto error;
diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 9b79a5e..8c4854d 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image *image, unsigned long ind_mfn,
             ret = kimage_add_page(image, page_to_maddr(xen_page));
             if ( ret < 0 )
                 goto done;
+
+            ret = machine_kexec_add_page(image, dest, dest);
+            if ( ret < 0 )
+                goto done;
+
             dest += PAGE_SIZE;
             break;
         }
--
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 Jul 14 15:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 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 1ZF22Z-0003bu-Uq; Tue, 14 Jul 2015 15:22:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22Y-0003bj-93
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:38 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	A0/17-22929-D3925A55; Tue, 14 Jul 2015 15:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1436887355!16974233!1
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 9028 invoked from network); 14 Jul 2015 15:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22T-0003oO-Pb
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22T-0004qb-Oc
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:33 +0000
Date: Tue, 14 Jul 2015 15:22:33 +0000
Message-Id: <E1ZF22T-0004qb-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] kexec: add more pages to v1
	environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b30aee44046f3989ca3c5a8d21cb961ad9da7266
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 13:52:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:52:27 2015 +0200

    kexec: add more pages to v1 environment
    
    Destination pages need mappings to be added to the page tables in the
    v1 case (where nothing else calls machine_kexec_add_page() for them).
    
    Further, without the tools mapping the low 1Mb (expected by at least
    some Linux version), we need to do so in the hypervisor in the v1 case.
    
    Suggested-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5cb57f4bddee1f11079e69bf43c193a8b104c476
    master date: 2015-06-09 16:00:24 +0200
---
 xen/common/kexec.c  |   18 ++++++++++++++++++
 xen/common/kimage.c |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 2239ee8..45954eb 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_load_v1_t *load, int compat)
     if ( ret < 0 )
         goto error;
 
+    if ( arch == EM_386 || arch == EM_X86_64 )
+    {
+        /*
+         * Ensure 0 - 1 MiB is mapped and accessible by the image.
+         *
+         * This allows access to VGA memory and the region purgatory copies
+         * in the crash case.
+         */
+        unsigned long addr;
+
+        for ( addr = 0; addr < MB(1); addr += PAGE_SIZE )
+        {
+            ret = machine_kexec_add_page(kimage, addr, addr);
+            if ( ret < 0 )
+                goto error;
+        }
+    }
+
     ret = kexec_load_slot(kimage);
     if ( ret < 0 )
         goto error;
diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 9b79a5e..8c4854d 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image *image, unsigned long ind_mfn,
             ret = kimage_add_page(image, page_to_maddr(xen_page));
             if ( ret < 0 )
                 goto done;
+
+            ret = machine_kexec_add_page(image, dest, dest);
+            if ( ret < 0 )
+                goto done;
+
             dest += PAGE_SIZE;
             break;
         }
--
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 Jul 14 15:22:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22i-0003dQ-17; Tue, 14 Jul 2015 15:22:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22g-0003d6-Fy
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:46 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	EA/6B-27764-54925A55; Tue, 14 Jul 2015 15:22:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1436887364!31956376!1
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 4534 invoked from network); 14 Jul 2015 15:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:22:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22d-0003oW-Tv
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22d-0004r4-T2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:43 +0000
Date: Tue, 14 Jul 2015 15:22:43 +0000
Message-Id: <E1ZF22d-0004r4-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/EFI: adjust EFI_MEMORY_WP
	handling for spec version 2.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ef863574851e22fc9185d90c2fd44ee1817d1e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 13:53:14 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:53:14 2015 +0200

    x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5
    
    That flag now means cachability rather than protection, and a new flag
    EFI_MEMORY_RO got added in its place.
    
    Along with EFI_MEMORY_RO also add the two other new EFI_MEMORY_*
    definitions, even if we don't need them right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 860313f0411d2dcc6b2fd78bfb834b39d05373a6
    master date: 2015-06-10 12:05:21 +0200
---
 xen/common/efi/boot.c    |   10 +++++++++-
 xen/include/efi/efidef.h |    6 +++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 58787a6..532ed8c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -32,6 +32,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define EFI_REVISION(major, minor) (((major) << 16) | (minor))
+
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -76,6 +78,7 @@ static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
 
 static const EFI_BOOT_SERVICES *__initdata efi_bs;
+static UINT32 __initdata efi_bs_revision;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
@@ -714,6 +717,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_ih = ImageHandle;
     efi_bs = SystemTable->BootServices;
+    efi_bs_revision = efi_bs->Hdr.Revision;
     efi_rs = SystemTable->RuntimeServices;
     efi_ct = SystemTable->ConfigurationTable;
     efi_num_ct = SystemTable->NumberOfTableEntries;
@@ -1221,6 +1225,9 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PAT | MAP_SMALL_PAGES;
         else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
+        else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
+                  (desc->Attribute & EFI_MEMORY_WP) )
+            prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
         else
         {
             printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n",
@@ -1230,7 +1237,8 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
         }
 
-        if ( desc->Attribute & EFI_MEMORY_WP )
+        if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5)
+                                ? EFI_MEMORY_WP : EFI_MEMORY_RO) )
             prot &= ~_PAGE_RW;
         if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
             prot |= _PAGE_NX_BIT;
diff --git a/xen/include/efi/efidef.h b/xen/include/efi/efidef.h
index 07fdf0d..86a7e11 100644
--- a/xen/include/efi/efidef.h
+++ b/xen/include/efi/efidef.h
@@ -156,11 +156,15 @@ typedef enum {
 #define EFI_MEMORY_WT           0x0000000000000004
 #define EFI_MEMORY_WB           0x0000000000000008
 #define EFI_MEMORY_UCE          0x0000000000000010  
+#define EFI_MEMORY_WP           0x0000000000001000
 
 // physical memory protection on range 
-#define EFI_MEMORY_WP           0x0000000000001000
 #define EFI_MEMORY_RP           0x0000000000002000
 #define EFI_MEMORY_XP           0x0000000000004000
+#define EFI_MEMORY_RO           0x0000000000020000
+
+#define EFI_MEMORY_NV           0x0000000000008000
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
 
 // range requires a runtime mapping
 #define EFI_MEMORY_RUNTIME      0x8000000000000000
--
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 Jul 14 15:22:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22i-0003dQ-17; Tue, 14 Jul 2015 15:22:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22g-0003d6-Fy
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:46 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	EA/6B-27764-54925A55; Tue, 14 Jul 2015 15:22:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1436887364!31956376!1
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 4534 invoked from network); 14 Jul 2015 15:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:22:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22d-0003oW-Tv
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22d-0004r4-T2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:43 +0000
Date: Tue, 14 Jul 2015 15:22:43 +0000
Message-Id: <E1ZF22d-0004r4-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/EFI: adjust EFI_MEMORY_WP
	handling for spec version 2.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ef863574851e22fc9185d90c2fd44ee1817d1e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 13:53:14 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:53:14 2015 +0200

    x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5
    
    That flag now means cachability rather than protection, and a new flag
    EFI_MEMORY_RO got added in its place.
    
    Along with EFI_MEMORY_RO also add the two other new EFI_MEMORY_*
    definitions, even if we don't need them right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 860313f0411d2dcc6b2fd78bfb834b39d05373a6
    master date: 2015-06-10 12:05:21 +0200
---
 xen/common/efi/boot.c    |   10 +++++++++-
 xen/include/efi/efidef.h |    6 +++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 58787a6..532ed8c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -32,6 +32,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define EFI_REVISION(major, minor) (((major) << 16) | (minor))
+
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -76,6 +78,7 @@ static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
 
 static const EFI_BOOT_SERVICES *__initdata efi_bs;
+static UINT32 __initdata efi_bs_revision;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
@@ -714,6 +717,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_ih = ImageHandle;
     efi_bs = SystemTable->BootServices;
+    efi_bs_revision = efi_bs->Hdr.Revision;
     efi_rs = SystemTable->RuntimeServices;
     efi_ct = SystemTable->ConfigurationTable;
     efi_num_ct = SystemTable->NumberOfTableEntries;
@@ -1221,6 +1225,9 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PAT | MAP_SMALL_PAGES;
         else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
+        else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
+                  (desc->Attribute & EFI_MEMORY_WP) )
+            prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
         else
         {
             printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n",
@@ -1230,7 +1237,8 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
         }
 
-        if ( desc->Attribute & EFI_MEMORY_WP )
+        if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5)
+                                ? EFI_MEMORY_WP : EFI_MEMORY_RO) )
             prot &= ~_PAGE_RW;
         if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
             prot |= _PAGE_NX_BIT;
diff --git a/xen/include/efi/efidef.h b/xen/include/efi/efidef.h
index 07fdf0d..86a7e11 100644
--- a/xen/include/efi/efidef.h
+++ b/xen/include/efi/efidef.h
@@ -156,11 +156,15 @@ typedef enum {
 #define EFI_MEMORY_WT           0x0000000000000004
 #define EFI_MEMORY_WB           0x0000000000000008
 #define EFI_MEMORY_UCE          0x0000000000000010  
+#define EFI_MEMORY_WP           0x0000000000001000
 
 // physical memory protection on range 
-#define EFI_MEMORY_WP           0x0000000000001000
 #define EFI_MEMORY_RP           0x0000000000002000
 #define EFI_MEMORY_XP           0x0000000000004000
+#define EFI_MEMORY_RO           0x0000000000020000
+
+#define EFI_MEMORY_NV           0x0000000000008000
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
 
 // range requires a runtime mapping
 #define EFI_MEMORY_RUNTIME      0x8000000000000000
--
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 Jul 14 15:22:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22s-0003ff-3j; Tue, 14 Jul 2015 15:22:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22q-0003fN-TV
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:57 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	FD/DC-31650-05925A55; Tue, 14 Jul 2015 15:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1436887374!31956447!1
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 5839 invoked from network); 14 Jul 2015 15:22:55 -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;
	14 Jul 2015 15:22:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22o-0003oe-2T
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22o-0004rX-1a
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:54 +0000
Date: Tue, 14 Jul 2015 15:22:54 +0000
Message-Id: <E1ZF22o-0004rX-1a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: avoid tripping watchdog when
	constructing dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d906addad0a1b18213e51bbcd783f80f320c61a6
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jul 13 13:53:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:53:56 2015 +0200

    x86: avoid tripping watchdog when constructing dom0
    
    Constructing dom0 may take a few seconds, particularly if the slow VESA
    graphics terminal is used. Process pending softirqs a few times to avoid
    tripping a watchdog with a short timeout.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move inclusion of xen/softirq.h (and at once clean up other includes).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c5089fae0f6f71443356530ecec4781788c7377a
    master date: 2015-06-12 12:07:05 +0200
---
 xen/arch/x86/domain_build.c        |    4 ++++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/common/libelf/libelf-private.h |    4 +---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7993b17..2006c52 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -817,6 +817,8 @@ int __init construct_dom0(
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
+    process_pending_softirqs();
+
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
@@ -1054,6 +1056,8 @@ int __init construct_dom0(
            _p(v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(parms.virt_entry));
 
+    process_pending_softirqs();
+
     mpt_alloc = (vpt_start - v_start) + pfn_to_paddr(alloc_spfn);
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 86403b9..0771323 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -235,6 +235,10 @@ static unsigned elf_xen_parse_notes(struct elf_binary *elf,
           ELF_HANDLE_PTRVAL(note) < parms->elf_note_end;
           note = elf_note_next(elf, note) )
     {
+#ifdef __XEN__
+        process_pending_softirqs();
+#endif
+
         if ( *total_note_count >= ELF_MAX_TOTAL_NOTE_COUNT )
         {
             elf_mark_broken(elf, "too many ELF notes");
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 854a0d7..dd4675a 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -18,11 +18,9 @@
 
 #ifdef __XEN__
 
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
+#include <xen/softirq.h>
 #include <asm/byteorder.h>
 #include <public/elfnote.h>
 
--
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 Jul 14 15:22:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:22:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF22s-0003ff-3j; Tue, 14 Jul 2015 15:22:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22q-0003fN-TV
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:57 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	FD/DC-31650-05925A55; Tue, 14 Jul 2015 15:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1436887374!31956447!1
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 5839 invoked from network); 14 Jul 2015 15:22:55 -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;
	14 Jul 2015 15:22:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22o-0003oe-2T
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22o-0004rX-1a
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:22:54 +0000
Date: Tue, 14 Jul 2015 15:22:54 +0000
Message-Id: <E1ZF22o-0004rX-1a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: avoid tripping watchdog when
	constructing dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d906addad0a1b18213e51bbcd783f80f320c61a6
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jul 13 13:53:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:53:56 2015 +0200

    x86: avoid tripping watchdog when constructing dom0
    
    Constructing dom0 may take a few seconds, particularly if the slow VESA
    graphics terminal is used. Process pending softirqs a few times to avoid
    tripping a watchdog with a short timeout.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move inclusion of xen/softirq.h (and at once clean up other includes).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c5089fae0f6f71443356530ecec4781788c7377a
    master date: 2015-06-12 12:07:05 +0200
---
 xen/arch/x86/domain_build.c        |    4 ++++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/common/libelf/libelf-private.h |    4 +---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7993b17..2006c52 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -817,6 +817,8 @@ int __init construct_dom0(
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
+    process_pending_softirqs();
+
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
@@ -1054,6 +1056,8 @@ int __init construct_dom0(
            _p(v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(parms.virt_entry));
 
+    process_pending_softirqs();
+
     mpt_alloc = (vpt_start - v_start) + pfn_to_paddr(alloc_spfn);
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 86403b9..0771323 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -235,6 +235,10 @@ static unsigned elf_xen_parse_notes(struct elf_binary *elf,
           ELF_HANDLE_PTRVAL(note) < parms->elf_note_end;
           note = elf_note_next(elf, note) )
     {
+#ifdef __XEN__
+        process_pending_softirqs();
+#endif
+
         if ( *total_note_count >= ELF_MAX_TOTAL_NOTE_COUNT )
         {
             elf_mark_broken(elf, "too many ELF notes");
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 854a0d7..dd4675a 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -18,11 +18,9 @@
 
 #ifdef __XEN__
 
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
+#include <xen/softirq.h>
 #include <asm/byteorder.h>
 #include <public/elfnote.h>
 
--
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 Jul 14 15:23:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:23: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 1ZF232-0003i4-8W; Tue, 14 Jul 2015 15:23: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 1ZF231-0003ho-At
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:07 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	CE/4E-03895-A5925A55; Tue, 14 Jul 2015 15:23:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1436887385!25778126!1
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 12906 invoked from network); 14 Jul 2015 15:23:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:23:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22y-0003pF-BF
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22y-0004sA-5k
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:04 +0000
Date: Tue, 14 Jul 2015 15:23:04 +0000
Message-Id: <E1ZF22y-0004sA-5k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/traps: avoid using current too
	early on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36a7c54a698db7d087873b312087cfa64de33175
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:54:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:54:47 2015 +0200

    x86/traps: avoid using current too early on boot
    
    Early on boot, current has the sentinel value 0xfffff000.  Blindly using it in
    show_registers() causes a nested failure and no useful information printed
    from an early crash.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 142473cfce41a565898e0fa33dc98a1f5e41abe4
    master date: 2015-06-25 14:57:04 +0200
---
 xen/arch/x86/x86_64/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 8a4b584..6477d1d 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -86,7 +86,7 @@ void show_registers(const struct cpu_user_regs *regs)
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
     enum context context;
-    struct vcpu *v = current;
+    struct vcpu *v = system_state >= SYS_STATE_smp_boot ? current : NULL;
 
     if ( guest_mode(regs) && has_hvm_container_vcpu(v) )
     {
--
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 Jul 14 15:23:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 15:23: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 1ZF232-0003i4-8W; Tue, 14 Jul 2015 15:23: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 1ZF231-0003ho-At
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:07 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	CE/4E-03895-A5925A55; Tue, 14 Jul 2015 15:23:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1436887385!25778126!1
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 12906 invoked from network); 14 Jul 2015 15:23:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 15:23:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22y-0003pF-BF
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF22y-0004sA-5k
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 15:23:04 +0000
Date: Tue, 14 Jul 2015 15:23:04 +0000
Message-Id: <E1ZF22y-0004sA-5k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/traps: avoid using current too
	early on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36a7c54a698db7d087873b312087cfa64de33175
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 13:54:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 13:54:47 2015 +0200

    x86/traps: avoid using current too early on boot
    
    Early on boot, current has the sentinel value 0xfffff000.  Blindly using it in
    show_registers() causes a nested failure and no useful information printed
    from an early crash.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 142473cfce41a565898e0fa33dc98a1f5e41abe4
    master date: 2015-06-25 14:57:04 +0200
---
 xen/arch/x86/x86_64/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 8a4b584..6477d1d 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -86,7 +86,7 @@ void show_registers(const struct cpu_user_regs *regs)
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
     enum context context;
-    struct vcpu *v = current;
+    struct vcpu *v = system_state >= SYS_STATE_smp_boot ? current : NULL;
 
     if ( guest_mode(regs) && has_hvm_container_vcpu(v) )
     {
--
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 Jul 14 23:11:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Lv-0002FE-F3; Tue, 14 Jul 2015 23:11: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 1ZF9Lu-0002F9-8b
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:06 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	E9/58-31258-90795A55; Tue, 14 Jul 2015 23:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1436915463!32125375!1
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 3957 invoked from network); 14 Jul 2015 23:11:04 -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;
	14 Jul 2015 23:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Lr-0000is-8b
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Lq-0006rw-RN
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:03 +0000
Date: Tue, 14 Jul 2015 23:11:02 +0000
Message-Id: <E1ZF9Lq-0006rw-RN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: identify the vcpu in
	context when dumping 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 fb9fdb08bb0d079f8d169615f3872f0538ab680d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 14:01:06 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:01:06 2015 +0200

    x86/traps: identify the vcpu in context when dumping registers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e59abf8c8c9c1d99a531292c6a548d6dfd0ceacc
    master date: 2015-04-14 14:59:53 +0200
---
 xen/arch/x86/x86_64/traps.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 90072c1..2ba8323 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -53,9 +53,11 @@ static void _show_registers(
     printk("\nRFLAGS: %016lx   ", regs->rflags);
     if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
         printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
-    printk("CONTEXT: %s\n", context_names[context]);
+    printk("CONTEXT: %s", context_names[context]);
+    if ( v && !is_idle_vcpu(v) )
+        printk(" (d%dv%d)", v->domain->domain_id, v->vcpu_id);
 
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
+    printk("\nrax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
            regs->rdx, regs->rsi, regs->rdi);
--
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 Tue Jul 14 23:11:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Lv-0002FE-F3; Tue, 14 Jul 2015 23:11: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 1ZF9Lu-0002F9-8b
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:06 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	E9/58-31258-90795A55; Tue, 14 Jul 2015 23:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1436915463!32125375!1
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 3957 invoked from network); 14 Jul 2015 23:11:04 -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;
	14 Jul 2015 23:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Lr-0000is-8b
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Lq-0006rw-RN
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:03 +0000
Date: Tue, 14 Jul 2015 23:11:02 +0000
Message-Id: <E1ZF9Lq-0006rw-RN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: identify the vcpu in
	context when dumping 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 fb9fdb08bb0d079f8d169615f3872f0538ab680d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 14:01:06 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:01:06 2015 +0200

    x86/traps: identify the vcpu in context when dumping registers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e59abf8c8c9c1d99a531292c6a548d6dfd0ceacc
    master date: 2015-04-14 14:59:53 +0200
---
 xen/arch/x86/x86_64/traps.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 90072c1..2ba8323 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -53,9 +53,11 @@ static void _show_registers(
     printk("\nRFLAGS: %016lx   ", regs->rflags);
     if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
         printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
-    printk("CONTEXT: %s\n", context_names[context]);
+    printk("CONTEXT: %s", context_names[context]);
+    if ( v && !is_idle_vcpu(v) )
+        printk(" (d%dv%d)", v->domain->domain_id, v->vcpu_id);
 
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
+    printk("\nrax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
            regs->rdx, regs->rsi, regs->rdi);
--
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 Tue Jul 14 23:11:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9M6-0002Fy-Hd; Tue, 14 Jul 2015 23:11: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 1ZF9M4-0002Fm-S2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:16 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	90/10-01068-41795A55; Tue, 14 Jul 2015 23:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1436915474!21414228!1
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 6625 invoked from network); 14 Jul 2015 23:11:15 -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;
	14 Jul 2015 23:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9M1-0000iw-Tq
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9M1-0006sO-DC
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:13 +0000
Date: Tue, 14 Jul 2015 23:11:13 +0000
Message-Id: <E1ZF9M1-0006sO-DC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] passthrough/amd: avoid reading an
	uninitialized variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f38be14c6a6780bd6f67da5e0866690eaca2c491
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Jul 13 14:02:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:02:00 2015 +0200

    passthrough/amd: avoid reading an uninitialized variable
    
    update_intremap_entry_from_msi() doesn't write to its data pointer on
    some error paths, so we copying that variable into the msg would count
    as undefined behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: a8ccf2d9f6f291f8fc6003e3d8bc7275ac1cc69f
    master date: 2015-04-24 12:04:57 +0200
---
 xen/drivers/passthrough/amd/iommu_intr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 18d8b5f..d3f3725 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -531,10 +531,12 @@ int amd_iommu_msi_msg_update_ire(
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
 
     if ( !rc )
+    {
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
+        msg->data = data;
+    }
 
-    msg->data = data;
     return rc;
 }
 
--
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 Tue Jul 14 23:11:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9M6-0002Fy-Hd; Tue, 14 Jul 2015 23:11: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 1ZF9M4-0002Fm-S2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:16 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	90/10-01068-41795A55; Tue, 14 Jul 2015 23:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1436915474!21414228!1
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 6625 invoked from network); 14 Jul 2015 23:11:15 -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;
	14 Jul 2015 23:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9M1-0000iw-Tq
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9M1-0006sO-DC
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:13 +0000
Date: Tue, 14 Jul 2015 23:11:13 +0000
Message-Id: <E1ZF9M1-0006sO-DC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] passthrough/amd: avoid reading an
	uninitialized variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f38be14c6a6780bd6f67da5e0866690eaca2c491
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Jul 13 14:02:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:02:00 2015 +0200

    passthrough/amd: avoid reading an uninitialized variable
    
    update_intremap_entry_from_msi() doesn't write to its data pointer on
    some error paths, so we copying that variable into the msg would count
    as undefined behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: a8ccf2d9f6f291f8fc6003e3d8bc7275ac1cc69f
    master date: 2015-04-24 12:04:57 +0200
---
 xen/drivers/passthrough/amd/iommu_intr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 18d8b5f..d3f3725 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -531,10 +531,12 @@ int amd_iommu_msi_msg_update_ire(
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
 
     if ( !rc )
+    {
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
+        msg->data = data;
+    }
 
-    msg->data = data;
     return rc;
 }
 
--
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 Tue Jul 14 23:11:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9MH-0002HE-KJ; Tue, 14 Jul 2015 23:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MF-0002H7-SV
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:27 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	DD/CB-03371-F1795A55; Tue, 14 Jul 2015 23:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1436915485!30927308!1
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 22230 invoked from network); 14 Jul 2015 23:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MC-0000j8-Is
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MC-0006sn-33
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:24 +0000
Date: Tue, 14 Jul 2015 23:11:24 +0000
Message-Id: <E1ZF9MC-0006sn-33@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] kexec: add more pages to v1
	environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b51d47e368ba1ede2681f59af23be9e6afe61ec7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 14:02:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:02:46 2015 +0200

    kexec: add more pages to v1 environment
    
    Destination pages need mappings to be added to the page tables in the
    v1 case (where nothing else calls machine_kexec_add_page() for them).
    
    Further, without the tools mapping the low 1Mb (expected by at least
    some Linux version), we need to do so in the hypervisor in the v1 case.
    
    Suggested-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5cb57f4bddee1f11079e69bf43c193a8b104c476
    master date: 2015-06-09 16:00:24 +0200
---
 xen/common/kexec.c  |   18 ++++++++++++++++++
 xen/common/kimage.c |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 23d964e..8b75280 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_load_v1_t *load, int compat)
     if ( ret < 0 )
         goto error;
 
+    if ( arch == EM_386 || arch == EM_X86_64 )
+    {
+        /*
+         * Ensure 0 - 1 MiB is mapped and accessible by the image.
+         *
+         * This allows access to VGA memory and the region purgatory copies
+         * in the crash case.
+         */
+        unsigned long addr;
+
+        for ( addr = 0; addr < MB(1); addr += PAGE_SIZE )
+        {
+            ret = machine_kexec_add_page(kimage, addr, addr);
+            if ( ret < 0 )
+                goto error;
+        }
+    }
+
     ret = kexec_load_slot(kimage);
     if ( ret < 0 )
         goto error;
diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 9b79a5e..8c4854d 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image *image, unsigned long ind_mfn,
             ret = kimage_add_page(image, page_to_maddr(xen_page));
             if ( ret < 0 )
                 goto done;
+
+            ret = machine_kexec_add_page(image, dest, dest);
+            if ( ret < 0 )
+                goto done;
+
             dest += PAGE_SIZE;
             break;
         }
--
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 Tue Jul 14 23:11:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9MH-0002HE-KJ; Tue, 14 Jul 2015 23:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MF-0002H7-SV
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:27 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	DD/CB-03371-F1795A55; Tue, 14 Jul 2015 23:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1436915485!30927308!1
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 22230 invoked from network); 14 Jul 2015 23:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MC-0000j8-Is
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MC-0006sn-33
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:24 +0000
Date: Tue, 14 Jul 2015 23:11:24 +0000
Message-Id: <E1ZF9MC-0006sn-33@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] kexec: add more pages to v1
	environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b51d47e368ba1ede2681f59af23be9e6afe61ec7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 14:02:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:02:46 2015 +0200

    kexec: add more pages to v1 environment
    
    Destination pages need mappings to be added to the page tables in the
    v1 case (where nothing else calls machine_kexec_add_page() for them).
    
    Further, without the tools mapping the low 1Mb (expected by at least
    some Linux version), we need to do so in the hypervisor in the v1 case.
    
    Suggested-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5cb57f4bddee1f11079e69bf43c193a8b104c476
    master date: 2015-06-09 16:00:24 +0200
---
 xen/common/kexec.c  |   18 ++++++++++++++++++
 xen/common/kimage.c |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 23d964e..8b75280 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_load_v1_t *load, int compat)
     if ( ret < 0 )
         goto error;
 
+    if ( arch == EM_386 || arch == EM_X86_64 )
+    {
+        /*
+         * Ensure 0 - 1 MiB is mapped and accessible by the image.
+         *
+         * This allows access to VGA memory and the region purgatory copies
+         * in the crash case.
+         */
+        unsigned long addr;
+
+        for ( addr = 0; addr < MB(1); addr += PAGE_SIZE )
+        {
+            ret = machine_kexec_add_page(kimage, addr, addr);
+            if ( ret < 0 )
+                goto error;
+        }
+    }
+
     ret = kexec_load_slot(kimage);
     if ( ret < 0 )
         goto error;
diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 9b79a5e..8c4854d 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image *image, unsigned long ind_mfn,
             ret = kimage_add_page(image, page_to_maddr(xen_page));
             if ( ret < 0 )
                 goto done;
+
+            ret = machine_kexec_add_page(image, dest, dest);
+            if ( ret < 0 )
+                goto done;
+
             dest += PAGE_SIZE;
             break;
         }
--
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 Tue Jul 14 23:11:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9MS-0002Ie-Mu; Tue, 14 Jul 2015 23:11:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MR-0002IV-R2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	27/5A-18947-B2795A55; Tue, 14 Jul 2015 23:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1436915495!26004530!1
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 8785 invoked from network); 14 Jul 2015 23:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MN-0000jG-3O
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MM-0006tA-PE
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:34 +0000
Date: Tue, 14 Jul 2015 23:11:34 +0000
Message-Id: <E1ZF9MM-0006tA-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: adjust EFI_MEMORY_WP
	handling for spec version 2.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea019a808b22c7f2c87bfd636aa8275f4cf8b431
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 14:04:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:04:04 2015 +0200

    x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5
    
    That flag now means cachability rather than protection, and a new flag
    EFI_MEMORY_RO got added in its place.
    
    Along with EFI_MEMORY_RO also add the two other new EFI_MEMORY_*
    definitions, even if we don't need them right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 860313f0411d2dcc6b2fd78bfb834b39d05373a6
    master date: 2015-06-10 12:05:21 +0200
---
 xen/arch/x86/efi/boot.c  |   10 +++++++++-
 xen/include/efi/efidef.h |    6 +++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 8178aea..011e443 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -29,6 +29,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define EFI_REVISION(major, minor) (((major) << 16) | (minor))
+
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -59,6 +61,7 @@ struct file {
 };
 
 static EFI_BOOT_SERVICES *__initdata efi_bs;
+static UINT32 __initdata efi_bs_revision;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
@@ -795,6 +798,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_ih = ImageHandle;
     efi_bs = SystemTable->BootServices;
+    efi_bs_revision = efi_bs->Hdr.Revision;
     efi_rs = SystemTable->RuntimeServices;
     efi_ct = SystemTable->ConfigurationTable;
     efi_num_ct = SystemTable->NumberOfTableEntries;
@@ -1650,6 +1654,9 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PAT | MAP_SMALL_PAGES;
         else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
+        else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
+                  (desc->Attribute & EFI_MEMORY_WP) )
+            prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
         else
         {
             printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n",
@@ -1659,7 +1666,8 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
         }
 
-        if ( desc->Attribute & EFI_MEMORY_WP )
+        if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5)
+                                ? EFI_MEMORY_WP : EFI_MEMORY_RO) )
             prot &= ~_PAGE_RW;
         if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
             prot |= _PAGE_NX_BIT;
diff --git a/xen/include/efi/efidef.h b/xen/include/efi/efidef.h
index 07fdf0d..86a7e11 100644
--- a/xen/include/efi/efidef.h
+++ b/xen/include/efi/efidef.h
@@ -156,11 +156,15 @@ typedef enum {
 #define EFI_MEMORY_WT           0x0000000000000004
 #define EFI_MEMORY_WB           0x0000000000000008
 #define EFI_MEMORY_UCE          0x0000000000000010  
+#define EFI_MEMORY_WP           0x0000000000001000
 
 // physical memory protection on range 
-#define EFI_MEMORY_WP           0x0000000000001000
 #define EFI_MEMORY_RP           0x0000000000002000
 #define EFI_MEMORY_XP           0x0000000000004000
+#define EFI_MEMORY_RO           0x0000000000020000
+
+#define EFI_MEMORY_NV           0x0000000000008000
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
 
 // range requires a runtime mapping
 #define EFI_MEMORY_RUNTIME      0x8000000000000000
--
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 Tue Jul 14 23:11:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9MS-0002Ie-Mu; Tue, 14 Jul 2015 23:11:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MR-0002IV-R2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	27/5A-18947-B2795A55; Tue, 14 Jul 2015 23:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1436915495!26004530!1
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 8785 invoked from network); 14 Jul 2015 23:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MN-0000jG-3O
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MM-0006tA-PE
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:34 +0000
Date: Tue, 14 Jul 2015 23:11:34 +0000
Message-Id: <E1ZF9MM-0006tA-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: adjust EFI_MEMORY_WP
	handling for spec version 2.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea019a808b22c7f2c87bfd636aa8275f4cf8b431
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 13 14:04:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:04:04 2015 +0200

    x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5
    
    That flag now means cachability rather than protection, and a new flag
    EFI_MEMORY_RO got added in its place.
    
    Along with EFI_MEMORY_RO also add the two other new EFI_MEMORY_*
    definitions, even if we don't need them right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 860313f0411d2dcc6b2fd78bfb834b39d05373a6
    master date: 2015-06-10 12:05:21 +0200
---
 xen/arch/x86/efi/boot.c  |   10 +++++++++-
 xen/include/efi/efidef.h |    6 +++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 8178aea..011e443 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -29,6 +29,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define EFI_REVISION(major, minor) (((major) << 16) | (minor))
+
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -59,6 +61,7 @@ struct file {
 };
 
 static EFI_BOOT_SERVICES *__initdata efi_bs;
+static UINT32 __initdata efi_bs_revision;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
@@ -795,6 +798,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_ih = ImageHandle;
     efi_bs = SystemTable->BootServices;
+    efi_bs_revision = efi_bs->Hdr.Revision;
     efi_rs = SystemTable->RuntimeServices;
     efi_ct = SystemTable->ConfigurationTable;
     efi_num_ct = SystemTable->NumberOfTableEntries;
@@ -1650,6 +1654,9 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PAT | MAP_SMALL_PAGES;
         else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
+        else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
+                  (desc->Attribute & EFI_MEMORY_WP) )
+            prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
         else
         {
             printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n",
@@ -1659,7 +1666,8 @@ void __init efi_init_memory(void)
             prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
         }
 
-        if ( desc->Attribute & EFI_MEMORY_WP )
+        if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5)
+                                ? EFI_MEMORY_WP : EFI_MEMORY_RO) )
             prot &= ~_PAGE_RW;
         if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
             prot |= _PAGE_NX_BIT;
diff --git a/xen/include/efi/efidef.h b/xen/include/efi/efidef.h
index 07fdf0d..86a7e11 100644
--- a/xen/include/efi/efidef.h
+++ b/xen/include/efi/efidef.h
@@ -156,11 +156,15 @@ typedef enum {
 #define EFI_MEMORY_WT           0x0000000000000004
 #define EFI_MEMORY_WB           0x0000000000000008
 #define EFI_MEMORY_UCE          0x0000000000000010  
+#define EFI_MEMORY_WP           0x0000000000001000
 
 // physical memory protection on range 
-#define EFI_MEMORY_WP           0x0000000000001000
 #define EFI_MEMORY_RP           0x0000000000002000
 #define EFI_MEMORY_XP           0x0000000000004000
+#define EFI_MEMORY_RO           0x0000000000020000
+
+#define EFI_MEMORY_NV           0x0000000000008000
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
 
 // range requires a runtime mapping
 #define EFI_MEMORY_RUNTIME      0x8000000000000000
--
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 Tue Jul 14 23:11:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Mb-0002KD-PT; Tue, 14 Jul 2015 23:11:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Ma-0002Jy-Ly
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:48 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BE/ED-17050-43795A55; Tue, 14 Jul 2015 23:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1436915506!21414302!1
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 8557 invoked from network); 14 Jul 2015 23:11:47 -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;
	14 Jul 2015 23:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MX-0000jO-JU
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MX-0006uH-8p
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:45 +0000
Date: Tue, 14 Jul 2015 23:11:45 +0000
Message-Id: <E1ZF9MX-0006uH-8p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: avoid tripping watchdog when
	constructing dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04667d68881f7103547b96e936e48dcde5ad4d21
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jul 13 14:04:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:04:58 2015 +0200

    x86: avoid tripping watchdog when constructing dom0
    
    Constructing dom0 may take a few seconds, particularly if the slow VESA
    graphics terminal is used. Process pending softirqs a few times to avoid
    tripping a watchdog with a short timeout.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move inclusion of xen/softirq.h (and at once clean up other includes).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c5089fae0f6f71443356530ecec4781788c7377a
    master date: 2015-06-12 12:07:05 +0200
---
 xen/arch/x86/domain_build.c        |    4 ++++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/common/libelf/libelf-private.h |    4 +---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 84ce392..ada4872 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -366,6 +366,8 @@ int __init construct_dom0(
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
+    process_pending_softirqs();
+
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
@@ -587,6 +589,8 @@ int __init construct_dom0(
            _p(v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(parms.virt_entry));
 
+    process_pending_softirqs();
+
     mpt_alloc = (vpt_start - v_start) + pfn_to_paddr(alloc_spfn);
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 86403b9..0771323 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -235,6 +235,10 @@ static unsigned elf_xen_parse_notes(struct elf_binary *elf,
           ELF_HANDLE_PTRVAL(note) < parms->elf_note_end;
           note = elf_note_next(elf, note) )
     {
+#ifdef __XEN__
+        process_pending_softirqs();
+#endif
+
         if ( *total_note_count >= ELF_MAX_TOTAL_NOTE_COUNT )
         {
             elf_mark_broken(elf, "too many ELF notes");
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index f4b79c7..63c6274 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -18,11 +18,9 @@
 
 #ifdef __XEN__
 
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
+#include <xen/softirq.h>
 #include <asm/byteorder.h>
 #include <public/elfnote.h>
 
--
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 Tue Jul 14 23:11:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:11:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Mb-0002KD-PT; Tue, 14 Jul 2015 23:11:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Ma-0002Jy-Ly
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:48 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BE/ED-17050-43795A55; Tue, 14 Jul 2015 23:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1436915506!21414302!1
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 8557 invoked from network); 14 Jul 2015 23:11:47 -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;
	14 Jul 2015 23:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MX-0000jO-JU
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9MX-0006uH-8p
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:45 +0000
Date: Tue, 14 Jul 2015 23:11:45 +0000
Message-Id: <E1ZF9MX-0006uH-8p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: avoid tripping watchdog when
	constructing dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04667d68881f7103547b96e936e48dcde5ad4d21
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jul 13 14:04:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:04:58 2015 +0200

    x86: avoid tripping watchdog when constructing dom0
    
    Constructing dom0 may take a few seconds, particularly if the slow VESA
    graphics terminal is used. Process pending softirqs a few times to avoid
    tripping a watchdog with a short timeout.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move inclusion of xen/softirq.h (and at once clean up other includes).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c5089fae0f6f71443356530ecec4781788c7377a
    master date: 2015-06-12 12:07:05 +0200
---
 xen/arch/x86/domain_build.c        |    4 ++++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/common/libelf/libelf-private.h |    4 +---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 84ce392..ada4872 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -366,6 +366,8 @@ int __init construct_dom0(
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
+    process_pending_softirqs();
+
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
@@ -587,6 +589,8 @@ int __init construct_dom0(
            _p(v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(parms.virt_entry));
 
+    process_pending_softirqs();
+
     mpt_alloc = (vpt_start - v_start) + pfn_to_paddr(alloc_spfn);
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 86403b9..0771323 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -235,6 +235,10 @@ static unsigned elf_xen_parse_notes(struct elf_binary *elf,
           ELF_HANDLE_PTRVAL(note) < parms->elf_note_end;
           note = elf_note_next(elf, note) )
     {
+#ifdef __XEN__
+        process_pending_softirqs();
+#endif
+
         if ( *total_note_count >= ELF_MAX_TOTAL_NOTE_COUNT )
         {
             elf_mark_broken(elf, "too many ELF notes");
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index f4b79c7..63c6274 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -18,11 +18,9 @@
 
 #ifdef __XEN__
 
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
+#include <xen/softirq.h>
 #include <asm/byteorder.h>
 #include <public/elfnote.h>
 
--
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 Tue Jul 14 23:12:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Mn-0002ME-SC; Tue, 14 Jul 2015 23:12:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mm-0002Ll-0d
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:12:00 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	3A/89-27764-E3795A55; Tue, 14 Jul 2015 23:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1436915516!24531758!1
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 8776 invoked from network); 14 Jul 2015 23:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mh-0000jW-W4
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mh-0006uk-O2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:55 +0000
Date: Tue, 14 Jul 2015 23:11:55 +0000
Message-Id: <E1ZF9Mh-0006uk-O2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: avoid using current too
	early on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33eba764618669b9c394c7d9cd2e335b426862ab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 14:05:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:05:58 2015 +0200

    x86/traps: avoid using current too early on boot
    
    Early on boot, current has the sentinel value 0xfffff000.  Blindly using it in
    show_registers() causes a nested failure and no useful information printed
    from an early crash.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 142473cfce41a565898e0fa33dc98a1f5e41abe4
    master date: 2015-06-25 14:57:04 +0200
---
 xen/arch/x86/x86_64/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 2ba8323..2a4b365 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -86,7 +86,7 @@ void show_registers(struct cpu_user_regs *regs)
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
     enum context context;
-    struct vcpu *v = current;
+    struct vcpu *v = this_cpu(curr_vcpu) ? current : NULL;
 
     if ( has_hvm_container_vcpu(v) && guest_mode(regs) )
     {
--
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 Tue Jul 14 23:12:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2015 23:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZF9Mn-0002ME-SC; Tue, 14 Jul 2015 23:12:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mm-0002Ll-0d
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:12:00 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	3A/89-27764-E3795A55; Tue, 14 Jul 2015 23:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1436915516!24531758!1
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 8776 invoked from network); 14 Jul 2015 23:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jul 2015 23:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mh-0000jW-W4
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZF9Mh-0006uk-O2
	for xen-changelog@lists.xensource.com; Tue, 14 Jul 2015 23:11:55 +0000
Date: Tue, 14 Jul 2015 23:11:55 +0000
Message-Id: <E1ZF9Mh-0006uk-O2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: avoid using current too
	early on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33eba764618669b9c394c7d9cd2e335b426862ab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 13 14:05:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 13 14:05:58 2015 +0200

    x86/traps: avoid using current too early on boot
    
    Early on boot, current has the sentinel value 0xfffff000.  Blindly using it in
    show_registers() causes a nested failure and no useful information printed
    from an early crash.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 142473cfce41a565898e0fa33dc98a1f5e41abe4
    master date: 2015-06-25 14:57:04 +0200
---
 xen/arch/x86/x86_64/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 2ba8323..2a4b365 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -86,7 +86,7 @@ void show_registers(struct cpu_user_regs *regs)
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
     enum context context;
-    struct vcpu *v = current;
+    struct vcpu *v = this_cpu(curr_vcpu) ? current : NULL;
 
     if ( has_hvm_container_vcpu(v) && guest_mode(regs) )
     {
--
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 Jul 20 12:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2015 12:11: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 1ZH9uZ-0003VY-Ge; Mon, 20 Jul 2015 12:11: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 1ZH9uY-0003VT-7U
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:10 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	9F/27-26139-D55ECA55; Mon, 20 Jul 2015 12:11:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1437394265!18194474!1
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 18762 invoked from network); 20 Jul 2015 12:11: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;
	20 Jul 2015 12:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZH9uT-0005wx-Li
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZH9uT-0001K7-Id
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:05 +0000
Date: Mon, 20 Jul 2015 12:11:05 +0000
Message-Id: <E1ZH9uT-0001K7-Id@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Initialise the fd of the
	unused half of a datacopier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***
    Previously reported histories end at:
        e01fa4e223fc077e18936d890dbd4813c3e7c9b1
        3a28f760508fb35c430edac17a9efde5aff6d1d5
        123c7793797502b222300eb710cd3873dcca41ee
        c40317f11b3f05e7c06a2213560c8471081f2662

commit 21d9b079e53805b68047d60d28cde224d09bbb40
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:59:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 17 18:10:00 2015 +0100

    tools/libxl: Initialise the fd of the unused half of a datacopier
    
    This bug causes a spurious failure if stdin happens to be an
    appropriately readable/writeable pipe which receives a POLLHUP
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 20 12:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2015 12:11: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 1ZH9uZ-0003VY-Ge; Mon, 20 Jul 2015 12:11: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 1ZH9uY-0003VT-7U
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:10 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	9F/27-26139-D55ECA55; Mon, 20 Jul 2015 12:11:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1437394265!18194474!1
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 18762 invoked from network); 20 Jul 2015 12:11: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;
	20 Jul 2015 12:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZH9uT-0005wx-Li
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZH9uT-0001K7-Id
	for xen-changelog@lists.xensource.com; Mon, 20 Jul 2015 12:11:05 +0000
Date: Mon, 20 Jul 2015 12:11:05 +0000
Message-Id: <E1ZH9uT-0001K7-Id@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Initialise the fd of the
	unused half of a datacopier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***
    Previously reported histories end at:
        e01fa4e223fc077e18936d890dbd4813c3e7c9b1
        3a28f760508fb35c430edac17a9efde5aff6d1d5
        123c7793797502b222300eb710cd3873dcca41ee
        c40317f11b3f05e7c06a2213560c8471081f2662

commit 21d9b079e53805b68047d60d28cde224d09bbb40
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:59:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 17 18:10:00 2015 +0100

    tools/libxl: Initialise the fd of the unused half of a datacopier
    
    This bug causes a spurious failure if stdin happens to be an
    appropriately readable/writeable pipe which receives a POLLHUP
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jul 22 03:00:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZHkGR-0003AD-HN; Wed, 22 Jul 2015 03:00: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 1ZHkGQ-0003A8-Ga
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:10 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	05/66-16813-9370FA55; Wed, 22 Jul 2015 03:00:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1437534008!34146543!1
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 13580 invoked from network); 22 Jul 2015 03:00:09 -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;
	22 Jul 2015 03:00:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGJ-0004TO-0H
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGI-0001bW-TT
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:02 +0000
Date: Wed, 22 Jul 2015 03:00:02 +0000
Message-Id: <E1ZHkGI-0001bW-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] nested EPT: fix the handling of
	nested EPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f51089d3c4a531376e099ee50d9dec0a3ec59c9d
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Tue Jul 21 11:15:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:15:35 2015 +0200

    nested EPT: fix the handling of nested EPT
    
    If the host EPT entry is changed, the nested EPT should be updated.
    the current code does not do this, and it's wrong.
    I have tested this patch, the L2 guest can boot and run as normal.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Reported-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 71bb7304e7a7a35ea6df4b0cedebc35028e4c159
    master date: 2015-06-30 15:00:54 +0100
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++++
 xen/arch/x86/mm/p2m.c     |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 92d9e2d..468033a 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -26,6 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/nestedhvm.h>
 #include <xen/iommu.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
@@ -704,6 +705,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
     ASSERT(local_irq_is_enabled());
 
+    if ( nestedhvm_enabled(d) && !p2m_is_nestedp2m(p2m) )
+        p2m_flush_nestedp2m(d);
+
     /*
      * Flush active cpus synchronously. Flush others the next time this domain
      * is scheduled onto them. We accept the race of other CPUs adding to
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 246ddd7..26dd79a 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1519,6 +1519,12 @@ p2m_flush_table(struct p2m_domain *p2m)
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
 
+    if ( p2m->np2m_base == P2M_BASE_EADDR )
+    {
+        p2m_unlock(p2m);
+        return;
+    }
+
     /* This is no longer a valid nested p2m for any address space */
     p2m->np2m_base = P2M_BASE_EADDR;
     
--
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 Wed Jul 22 03:00:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZHkGR-0003AD-HN; Wed, 22 Jul 2015 03:00: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 1ZHkGQ-0003A8-Ga
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:10 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	05/66-16813-9370FA55; Wed, 22 Jul 2015 03:00:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1437534008!34146543!1
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 13580 invoked from network); 22 Jul 2015 03:00:09 -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;
	22 Jul 2015 03:00:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGJ-0004TO-0H
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGI-0001bW-TT
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:02 +0000
Date: Wed, 22 Jul 2015 03:00:02 +0000
Message-Id: <E1ZHkGI-0001bW-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] nested EPT: fix the handling of
	nested EPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f51089d3c4a531376e099ee50d9dec0a3ec59c9d
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Tue Jul 21 11:15:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:15:35 2015 +0200

    nested EPT: fix the handling of nested EPT
    
    If the host EPT entry is changed, the nested EPT should be updated.
    the current code does not do this, and it's wrong.
    I have tested this patch, the L2 guest can boot and run as normal.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Reported-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 71bb7304e7a7a35ea6df4b0cedebc35028e4c159
    master date: 2015-06-30 15:00:54 +0100
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++++
 xen/arch/x86/mm/p2m.c     |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 92d9e2d..468033a 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -26,6 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/nestedhvm.h>
 #include <xen/iommu.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
@@ -704,6 +705,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
     ASSERT(local_irq_is_enabled());
 
+    if ( nestedhvm_enabled(d) && !p2m_is_nestedp2m(p2m) )
+        p2m_flush_nestedp2m(d);
+
     /*
      * Flush active cpus synchronously. Flush others the next time this domain
      * is scheduled onto them. We accept the race of other CPUs adding to
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 246ddd7..26dd79a 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1519,6 +1519,12 @@ p2m_flush_table(struct p2m_domain *p2m)
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
 
+    if ( p2m->np2m_base == P2M_BASE_EADDR )
+    {
+        p2m_unlock(p2m);
+        return;
+    }
+
     /* This is no longer a valid nested p2m for any address space */
     p2m->np2m_base = P2M_BASE_EADDR;
     
--
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 Wed Jul 22 03:00:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZHkGZ-0003Aq-Jo; Wed, 22 Jul 2015 03:00: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 1ZHkGY-0003Ag-IE
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	92/5F-10593-1470FA55; Wed, 22 Jul 2015 03:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437534014!25602053!1
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 5257 invoked from network); 22 Jul 2015 03:00:16 -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;
	22 Jul 2015 03:00:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGU-0004TV-Bg
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGT-0001bx-3z
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:14 +0000
Date: Wed, 22 Jul 2015 03:00:13 +0000
Message-Id: <E1ZHkGT-0001bx-3z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-ept: don't unmap the EPT
	pagetable while it is still in 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 cc87ed9e0576bee556120dc1fd0e3d7e339e860d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:16:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:16:24 2015 +0200

    x86/p2m-ept: don't unmap the EPT pagetable while it is still in use
    
    The call to iommu_pte_flush() between the two hunks uses &ept_entry->epte
    which is a pointer into the mapped page.
    
    It is eventually passed to `clflush` instruction which will suffer a pagefault
    if the virtual mapping has fallen out of the TLB.
    
        (XEN) ----[ Xen-4.5.0-xs102594-d  x86_64  debug=y  Not tainted ]----
        (XEN) CPU:    7
        (XEN) RIP:    e008:[<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        <snip>
        (XEN) Xen call trace:
        (XEN)    [<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        (XEN)    [<ffff82d08014ffff>] __iommu_flush_cache+0x4a/0x6a
        (XEN)    [<ffff82d0801532e2>] iommu_pte_flush+0x2b/0xd5
        (XEN)    [<ffff82d0801f909a>] ept_set_entry+0x4bc/0x61f
        (XEN)    [<ffff82d0801f0c25>] p2m_set_entry+0xd1/0x112
        (XEN)    [<ffff82d0801f25b1>] clear_mmio_p2m_entry+0x1a0/0x200
        (XEN)    [<ffff82d0801f4aac>] unmap_mmio_regions+0x49/0x73
        (XEN)    [<ffff82d080106292>] do_domctl+0x15bd/0x1edb
        (XEN)    [<ffff82d080234fcb>] syscall_enter+0xeb/0x145
        (XEN)
        (XEN) Pagetable walk from ffff820040004ae0:
        (XEN)  L4[0x104] = 00000008668a5063 ffffffffffffffff
        (XEN)  L3[0x001] = 00000008668a3063 ffffffffffffffff
        (XEN)  L2[0x000] = 000000086689c063 ffffffffffffffff
        (XEN)  L1[0x004] = 000000056f078063 000000000007f678
        (XEN)
        (XEN) ****************************************
        (XEN) Panic on CPU 7:
        (XEN) FATAL PAGE FAULT
        (XEN) [error_code=0000]
        (XEN) Faulting linear address: ffff820040004ae0
        (XEN) ****************************************
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e4e9d2d4e76bd8fe229c124bd57fc6ba824271b3
    master date: 2015-07-07 11:37:26 +0200
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 468033a..bdc95e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -440,8 +440,6 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     rv = 1;
 
 out:
-    unmap_domain_page(table);
-
     if ( needs_sync )
         ept_sync_domain(p2m);
 
@@ -479,6 +477,8 @@ out:
         }
     }
 
+    unmap_domain_page(table);
+
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
--
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 Wed Jul 22 03:00:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZHkGZ-0003Aq-Jo; Wed, 22 Jul 2015 03:00: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 1ZHkGY-0003Ag-IE
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	92/5F-10593-1470FA55; Wed, 22 Jul 2015 03:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437534014!25602053!1
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 5257 invoked from network); 22 Jul 2015 03:00:16 -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;
	22 Jul 2015 03:00:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGU-0004TV-Bg
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGT-0001bx-3z
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:14 +0000
Date: Wed, 22 Jul 2015 03:00:13 +0000
Message-Id: <E1ZHkGT-0001bx-3z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-ept: don't unmap the EPT
	pagetable while it is still in 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 cc87ed9e0576bee556120dc1fd0e3d7e339e860d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:16:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:16:24 2015 +0200

    x86/p2m-ept: don't unmap the EPT pagetable while it is still in use
    
    The call to iommu_pte_flush() between the two hunks uses &ept_entry->epte
    which is a pointer into the mapped page.
    
    It is eventually passed to `clflush` instruction which will suffer a pagefault
    if the virtual mapping has fallen out of the TLB.
    
        (XEN) ----[ Xen-4.5.0-xs102594-d  x86_64  debug=y  Not tainted ]----
        (XEN) CPU:    7
        (XEN) RIP:    e008:[<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        <snip>
        (XEN) Xen call trace:
        (XEN)    [<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        (XEN)    [<ffff82d08014ffff>] __iommu_flush_cache+0x4a/0x6a
        (XEN)    [<ffff82d0801532e2>] iommu_pte_flush+0x2b/0xd5
        (XEN)    [<ffff82d0801f909a>] ept_set_entry+0x4bc/0x61f
        (XEN)    [<ffff82d0801f0c25>] p2m_set_entry+0xd1/0x112
        (XEN)    [<ffff82d0801f25b1>] clear_mmio_p2m_entry+0x1a0/0x200
        (XEN)    [<ffff82d0801f4aac>] unmap_mmio_regions+0x49/0x73
        (XEN)    [<ffff82d080106292>] do_domctl+0x15bd/0x1edb
        (XEN)    [<ffff82d080234fcb>] syscall_enter+0xeb/0x145
        (XEN)
        (XEN) Pagetable walk from ffff820040004ae0:
        (XEN)  L4[0x104] = 00000008668a5063 ffffffffffffffff
        (XEN)  L3[0x001] = 00000008668a3063 ffffffffffffffff
        (XEN)  L2[0x000] = 000000086689c063 ffffffffffffffff
        (XEN)  L1[0x004] = 000000056f078063 000000000007f678
        (XEN)
        (XEN) ****************************************
        (XEN) Panic on CPU 7:
        (XEN) FATAL PAGE FAULT
        (XEN) [error_code=0000]
        (XEN) Faulting linear address: ffff820040004ae0
        (XEN) ****************************************
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e4e9d2d4e76bd8fe229c124bd57fc6ba824271b3
    master date: 2015-07-07 11:37:26 +0200
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 468033a..bdc95e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -440,8 +440,6 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     rv = 1;
 
 out:
-    unmap_domain_page(table);
-
     if ( needs_sync )
         ept_sync_domain(p2m);
 
@@ -479,6 +477,8 @@ out:
         }
     }
 
+    unmap_domain_page(table);
+
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
--
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 Wed Jul 22 03:00:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkGi-0003CB-MS; Wed, 22 Jul 2015 03:00:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGh-0003C4-PJ
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:27 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	2C/A4-29123-B470FA55; Wed, 22 Jul 2015 03:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1437534024!34043271!1
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 20409 invoked from network); 22 Jul 2015 03:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jul 2015 03:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGe-0004Tg-HD
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGe-0001cY-Ek
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:24 +0000
Date: Wed, 22 Jul 2015 03:00:24 +0000
Message-Id: <E1ZHkGe-0001cY-Ek@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86 / cpupool: clear the proper
	cpu_valid bit on pCPU teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ee0f1aed01daff6b560d473d1050417a802a59c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:16:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:16:58 2015 +0200

    x86 / cpupool: clear the proper cpu_valid bit on pCPU teardown
    
    In fact, when a pCPU goes down, we want to clear its
    bit in the correct cpupool's valid mask, rather than
    always in cpupool0's one.
    
    Before this commit, all the pCPUs in the non-default
    pool(s) will be considered immediately valid, during
    system resume, even the one that have not been brought
    up yet. As a result, the (Credit1) scheduler will attempt
    to run its load balancing logic on them, causing the
    following Oops:
    
    # xl cpupool-cpu-remove Pool-0 8-15
    # xl cpupool-create name=\"Pool-1\"
    # xl cpupool-cpu-add Pool-1 8-15
    --> suspend
    --> resume
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    8
    (XEN) RIP:    e008:[<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN) RFLAGS: 0000000000010087   CONTEXT: hypervisor
    (XEN) rax: 80007d2f7fccb780   rbx: 0000000000000009   rcx: 0000000000000000
    (XEN) rdx: ffff82d08031ed40   rsi: ffff82d080334980   rdi: 0000000000000000
    (XEN) rbp: ffff83010000fe20   rsp: ffff83010000fd40   r8:  0000000000000004
    (XEN) r9:  0000ffff0000ffff   r10: 00ff00ff00ff00ff   r11: 0f0f0f0f0f0f0f0f
    (XEN) r12: ffff8303191ea870   r13: ffff8303226aadf0   r14: 0000000000000009
    (XEN) r15: 0000000000000008   cr0: 000000008005003b   cr4: 00000000000026f0
    (XEN) cr3: 00000000dba9d000   cr2: 0000000000000000
    (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN)    [<ffff82d08012c732>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012f8c8>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012f920>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164791>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The reason why the error is a #GP fault is that, without
    this commit, we try to access the per-cpu area of a not
    yet allocated and initialized pCPU.
    In fact, %rax, which is what is used as pointer, is
    80007d2f7fccb780, and we also have this:
    
    #define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    master commit: 8022b05284dea80e24813d03180788ec7277a0bd
    master date: 2015-07-07 14:29:39 +0200
---
 xen/arch/x86/smpboot.c |    1 -
 xen/common/cpupool.c   |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 42b8a59..7a1eac6 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -834,7 +834,6 @@ void __cpu_disable(void)
     remove_siblinginfo(cpu);
 
     /* It's now safe to remove this processor from the online map */
-    cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
     cpumask_clear_cpu(cpu, &cpu_online_map);
     fixup_irqs();
 
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index f089d24..db275bf 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -529,6 +529,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
             if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
             {
                 cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+                cpumask_clear_cpu(cpu, (*c)->cpu_valid);
                 break;
             }
         }
@@ -551,6 +552,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
          * If we are not suspending, we are hot-unplugging cpu, and that is
          * allowed only for CPUs in pool0.
          */
+        cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
         ret = 0;
     }
 
--
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 Wed Jul 22 03:00:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkGi-0003CB-MS; Wed, 22 Jul 2015 03:00:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGh-0003C4-PJ
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:27 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	2C/A4-29123-B470FA55; Wed, 22 Jul 2015 03:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1437534024!34043271!1
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 20409 invoked from network); 22 Jul 2015 03:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jul 2015 03:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGe-0004Tg-HD
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGe-0001cY-Ek
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:24 +0000
Date: Wed, 22 Jul 2015 03:00:24 +0000
Message-Id: <E1ZHkGe-0001cY-Ek@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86 / cpupool: clear the proper
	cpu_valid bit on pCPU teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ee0f1aed01daff6b560d473d1050417a802a59c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:16:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:16:58 2015 +0200

    x86 / cpupool: clear the proper cpu_valid bit on pCPU teardown
    
    In fact, when a pCPU goes down, we want to clear its
    bit in the correct cpupool's valid mask, rather than
    always in cpupool0's one.
    
    Before this commit, all the pCPUs in the non-default
    pool(s) will be considered immediately valid, during
    system resume, even the one that have not been brought
    up yet. As a result, the (Credit1) scheduler will attempt
    to run its load balancing logic on them, causing the
    following Oops:
    
    # xl cpupool-cpu-remove Pool-0 8-15
    # xl cpupool-create name=\"Pool-1\"
    # xl cpupool-cpu-add Pool-1 8-15
    --> suspend
    --> resume
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    8
    (XEN) RIP:    e008:[<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN) RFLAGS: 0000000000010087   CONTEXT: hypervisor
    (XEN) rax: 80007d2f7fccb780   rbx: 0000000000000009   rcx: 0000000000000000
    (XEN) rdx: ffff82d08031ed40   rsi: ffff82d080334980   rdi: 0000000000000000
    (XEN) rbp: ffff83010000fe20   rsp: ffff83010000fd40   r8:  0000000000000004
    (XEN) r9:  0000ffff0000ffff   r10: 00ff00ff00ff00ff   r11: 0f0f0f0f0f0f0f0f
    (XEN) r12: ffff8303191ea870   r13: ffff8303226aadf0   r14: 0000000000000009
    (XEN) r15: 0000000000000008   cr0: 000000008005003b   cr4: 00000000000026f0
    (XEN) cr3: 00000000dba9d000   cr2: 0000000000000000
    (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN)    [<ffff82d08012c732>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012f8c8>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012f920>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164791>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The reason why the error is a #GP fault is that, without
    this commit, we try to access the per-cpu area of a not
    yet allocated and initialized pCPU.
    In fact, %rax, which is what is used as pointer, is
    80007d2f7fccb780, and we also have this:
    
    #define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    master commit: 8022b05284dea80e24813d03180788ec7277a0bd
    master date: 2015-07-07 14:29:39 +0200
---
 xen/arch/x86/smpboot.c |    1 -
 xen/common/cpupool.c   |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 42b8a59..7a1eac6 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -834,7 +834,6 @@ void __cpu_disable(void)
     remove_siblinginfo(cpu);
 
     /* It's now safe to remove this processor from the online map */
-    cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
     cpumask_clear_cpu(cpu, &cpu_online_map);
     fixup_irqs();
 
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index f089d24..db275bf 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -529,6 +529,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
             if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
             {
                 cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+                cpumask_clear_cpu(cpu, (*c)->cpu_valid);
                 break;
             }
         }
@@ -551,6 +552,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
          * If we are not suspending, we are hot-unplugging cpu, and that is
          * allowed only for CPUs in pool0.
          */
+        cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
         ret = 0;
     }
 
--
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 Wed Jul 22 03:00:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkGs-0003Di-P6; Wed, 22 Jul 2015 03:00:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGr-0003DS-Lq
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:37 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	55/4A-31650-4570FA55; Wed, 22 Jul 2015 03:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437534034!34127946!1
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 24274 invoked from network); 22 Jul 2015 03:00:35 -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;
	22 Jul 2015 03:00:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGo-0004To-QN
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGo-0001dM-Kr
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:34 +0000
Date: Wed, 22 Jul 2015 03:00:34 +0000
Message-Id: <E1ZHkGo-0001dM-Kr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] credit1: properly deal with pCPUs
	not in any cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ee998c4c11da8682edd609e6521cb667cf8a4c3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:17:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:17:29 2015 +0200

    credit1: properly deal with pCPUs not in any cpupool
    
    Ideally, the pCPUs that are 'free', i.e., not assigned
    to any cpupool, should not be considred by the scheduler
    for load balancing or anything. In Credit1, we fail at
    this, because of how we use cpupool_scheduler_cpumask().
    In fact, for a free pCPU, cpupool_scheduler_cpumask()
    returns a pointer to cpupool_free_cpus, and hence, near
    the top of csched_load_balance():
    
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
         goto out;
    
    is false (the pCPU _is_ free!), and we therefore do not
    jump to the end right away, as we should. This, causes
    the following splat when resuming from ACPI S3 with
    pCPUs not assigned to any pool:
    
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080122eaa>] csched_load_balance+0x213/0x794
    (XEN)    [<ffff82d08012374c>] csched_schedule+0x321/0x452
    (XEN)    [<ffff82d08012c85e>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012fa09>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012fa61>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164780>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The cure is:
     * use cpupool_online_cpumask(), as a better guard to the
       case when the cpu is being offlined;
     * explicitly check whether the cpu is free.
    
    SEDF is in a similar situation, so fix it too.
    
    Still in Credit1, we must make sure that free (or offline)
    CPUs are not considered "ticklable". Not doing so would impair
    the load balancing algorithm, making the scheduler think that
    it is possible to 'ask' the pCPU to pick up some work, while
    in reallity, that will never happen! Evidence of such behavior
    is shown in this trace:
    
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
    
        0.112998198 | ||.|| -|x||-|- d0v0 runstate_change d0v4 offline->runnable
     ]  0.112998198 | ||.|| -|x||-|- d0v0   22006(2:2:6) 1 [ f ]
     ]  0.112999612 | ||.|| -|x||-|- d0v0   28004(2:8:4) 2 [ 0 4 ]
        0.113003387 | ||.|| -||||-|x d32767v15 runstate_continue d32767v15 running->running
    
    where "22006(2:2:6) 1 [ f ]" means that pCPU 15, which is
    free from any pool, is tickled.
    
    The cure, in this case, is to filter out the free pCPUs,
    within __runq_tickle().
    
    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>
    master commit: 02ea5031825d984d52eb9a982b8457e3434137f0
    master date: 2015-07-07 14:30:06 +0200
---
 xen/common/sched_credit.c |   23 ++++++++++++++++-------
 xen/common/sched_sedf.c   |    3 ++-
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index db5512e..1d38adb 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -371,12 +371,17 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask, idle_mask;
+    cpumask_t mask, idle_mask, *online;
     int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-    idlers_empty = cpumask_empty(prv->idlers);
+
+    /* cpu is vc->processor, so it must be in a cpupool. */
+    ASSERT(per_cpu(cpupool, cpu) != NULL);
+    online = cpupool_online_cpumask(per_cpu(cpupool, cpu));
+    cpumask_and(&idle_mask, prv->idlers, online);
+    idlers_empty = cpumask_empty(&idle_mask);
 
 
     /*
@@ -413,8 +418,8 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
             /* Are there idlers suitable for new (for this balance step)? */
             csched_balance_cpumask(new->vcpu, balance_step,
                                    csched_balance_mask);
-            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
-            new_idlers_empty = cpumask_empty(&idle_mask);
+            cpumask_and(csched_balance_mask, csched_balance_mask, &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask);
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1525,6 +1530,7 @@ static struct csched_vcpu *
 csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *snext, bool_t *stolen)
 {
+    struct cpupool *c = per_cpu(cpupool, cpu);
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
@@ -1532,10 +1538,13 @@ csched_load_balance(struct csched_private *prv, int cpu,
     int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
+    online = cpupool_online_cpumask(c);
 
-    /* If this CPU is going offline we shouldn't steal work. */
-    if ( unlikely(!cpumask_test_cpu(cpu, online)) )
+    /*
+     * If this CPU is going offline, or is not (yet) part of any cpupool
+     * (as it happens, e.g., during cpu bringup), we shouldn't steal work.
+     */
+    if ( unlikely(!cpumask_test_cpu(cpu, online) || c == NULL) )
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 7c24171..b0c28be 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -803,7 +803,8 @@ static struct task_slice sedf_do_schedule(
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu,
-                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
+                   cpupool_online_cpumask(per_cpu(cpupool, cpu))) ||
+                  per_cpu(cpupool, cpu) == NULL) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
--
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 Wed Jul 22 03:00:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkGs-0003Di-P6; Wed, 22 Jul 2015 03:00:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGr-0003DS-Lq
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:37 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	55/4A-31650-4570FA55; Wed, 22 Jul 2015 03:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437534034!34127946!1
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 24274 invoked from network); 22 Jul 2015 03:00:35 -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;
	22 Jul 2015 03:00:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGo-0004To-QN
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGo-0001dM-Kr
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:34 +0000
Date: Wed, 22 Jul 2015 03:00:34 +0000
Message-Id: <E1ZHkGo-0001dM-Kr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] credit1: properly deal with pCPUs
	not in any cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ee998c4c11da8682edd609e6521cb667cf8a4c3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:17:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:17:29 2015 +0200

    credit1: properly deal with pCPUs not in any cpupool
    
    Ideally, the pCPUs that are 'free', i.e., not assigned
    to any cpupool, should not be considred by the scheduler
    for load balancing or anything. In Credit1, we fail at
    this, because of how we use cpupool_scheduler_cpumask().
    In fact, for a free pCPU, cpupool_scheduler_cpumask()
    returns a pointer to cpupool_free_cpus, and hence, near
    the top of csched_load_balance():
    
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
         goto out;
    
    is false (the pCPU _is_ free!), and we therefore do not
    jump to the end right away, as we should. This, causes
    the following splat when resuming from ACPI S3 with
    pCPUs not assigned to any pool:
    
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080122eaa>] csched_load_balance+0x213/0x794
    (XEN)    [<ffff82d08012374c>] csched_schedule+0x321/0x452
    (XEN)    [<ffff82d08012c85e>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012fa09>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012fa61>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164780>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The cure is:
     * use cpupool_online_cpumask(), as a better guard to the
       case when the cpu is being offlined;
     * explicitly check whether the cpu is free.
    
    SEDF is in a similar situation, so fix it too.
    
    Still in Credit1, we must make sure that free (or offline)
    CPUs are not considered "ticklable". Not doing so would impair
    the load balancing algorithm, making the scheduler think that
    it is possible to 'ask' the pCPU to pick up some work, while
    in reallity, that will never happen! Evidence of such behavior
    is shown in this trace:
    
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
    
        0.112998198 | ||.|| -|x||-|- d0v0 runstate_change d0v4 offline->runnable
     ]  0.112998198 | ||.|| -|x||-|- d0v0   22006(2:2:6) 1 [ f ]
     ]  0.112999612 | ||.|| -|x||-|- d0v0   28004(2:8:4) 2 [ 0 4 ]
        0.113003387 | ||.|| -||||-|x d32767v15 runstate_continue d32767v15 running->running
    
    where "22006(2:2:6) 1 [ f ]" means that pCPU 15, which is
    free from any pool, is tickled.
    
    The cure, in this case, is to filter out the free pCPUs,
    within __runq_tickle().
    
    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>
    master commit: 02ea5031825d984d52eb9a982b8457e3434137f0
    master date: 2015-07-07 14:30:06 +0200
---
 xen/common/sched_credit.c |   23 ++++++++++++++++-------
 xen/common/sched_sedf.c   |    3 ++-
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index db5512e..1d38adb 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -371,12 +371,17 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask, idle_mask;
+    cpumask_t mask, idle_mask, *online;
     int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-    idlers_empty = cpumask_empty(prv->idlers);
+
+    /* cpu is vc->processor, so it must be in a cpupool. */
+    ASSERT(per_cpu(cpupool, cpu) != NULL);
+    online = cpupool_online_cpumask(per_cpu(cpupool, cpu));
+    cpumask_and(&idle_mask, prv->idlers, online);
+    idlers_empty = cpumask_empty(&idle_mask);
 
 
     /*
@@ -413,8 +418,8 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
             /* Are there idlers suitable for new (for this balance step)? */
             csched_balance_cpumask(new->vcpu, balance_step,
                                    csched_balance_mask);
-            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
-            new_idlers_empty = cpumask_empty(&idle_mask);
+            cpumask_and(csched_balance_mask, csched_balance_mask, &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask);
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1525,6 +1530,7 @@ static struct csched_vcpu *
 csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *snext, bool_t *stolen)
 {
+    struct cpupool *c = per_cpu(cpupool, cpu);
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
@@ -1532,10 +1538,13 @@ csched_load_balance(struct csched_private *prv, int cpu,
     int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
+    online = cpupool_online_cpumask(c);
 
-    /* If this CPU is going offline we shouldn't steal work. */
-    if ( unlikely(!cpumask_test_cpu(cpu, online)) )
+    /*
+     * If this CPU is going offline, or is not (yet) part of any cpupool
+     * (as it happens, e.g., during cpu bringup), we shouldn't steal work.
+     */
+    if ( unlikely(!cpumask_test_cpu(cpu, online) || c == NULL) )
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 7c24171..b0c28be 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -803,7 +803,8 @@ static struct task_slice sedf_do_schedule(
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu,
-                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
+                   cpupool_online_cpumask(per_cpu(cpupool, cpu))) ||
+                  per_cpu(cpupool, cpu) == NULL) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
--
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 Wed Jul 22 03:00:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkH3-0003FJ-Ro; Wed, 22 Jul 2015 03:00: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 1ZHkH2-0003F5-7w
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:48 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	96/FB-21947-F570FA55; Wed, 22 Jul 2015 03:00:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1437534046!17453307!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 14965 invoked from network); 22 Jul 2015 03:00:46 -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;
	22 Jul 2015 03:00:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGz-0004Tw-Sj
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGy-0001du-UZ
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:45 +0000
Date: Wed, 22 Jul 2015 03:00:44 +0000
Message-Id: <E1ZHkGy-0001du-UZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/hvmloader: avoid data
	corruption with xenstore reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4ee871b3854aff074d329f63186325b8f896f5b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:18:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:18:09 2015 +0200

    x86/hvmloader: avoid data corruption with xenstore reads/writes
    
    The functions ring_read and ring_write() have logic to try and deal with
    partial reads and writes.
    
    However, in all cases where the "while (len)" loop executed twice, data
    corruption would occur as the second memcpy() starts from the beginning of
    "data" again, rather than from where it got to.
    
    This bug manifested itself as protocol corruption when a reply header crossed
    the first wrap of the response ring.  However, similar corruption would also
    occur if hvmloader observed xenstored performing partial writes of the block
    in question, or if hvmloader had to wait for xenstored to make space in either
    ring.
    
    Reported-by: Adam Kucia <djexit@o2.pl>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bbbe7e7157a964c485fb861765be291734676932
    master date: 2015-07-07 14:39:27 +0200
---
 tools/firmware/hvmloader/xenbus.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index fe72e97..c513260 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -97,7 +97,7 @@ static void ring_wait(void)
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -114,16 +114,18 @@ static void ring_write(const char *data, uint32_t len)
         if ( part > len ) 
             part = len;
 
-        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod), data, part);
+        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod),
+               data + done, part);
         barrier(); /* = wmb before prod write, rmb before next cons read */
         rings->req_prod += part;
         len -= part;
+        done += part;
     }
 }
 
 static void ring_read(char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -140,10 +142,12 @@ static void ring_read(char *data, uint32_t len)
         if ( part > len )
             part = len;
 
-        memcpy(data, rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
+        memcpy(data + done,
+               rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
         barrier(); /* = wmb before cons write, rmb before next prod read */
         rings->rsp_cons += part;
         len -= part;
+        done += part;
     }
 }
 
--
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 Wed Jul 22 03:00:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:00: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 1ZHkH3-0003FJ-Ro; Wed, 22 Jul 2015 03:00: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 1ZHkH2-0003F5-7w
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:48 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	96/FB-21947-F570FA55; Wed, 22 Jul 2015 03:00:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1437534046!17453307!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 14965 invoked from network); 22 Jul 2015 03:00:46 -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;
	22 Jul 2015 03:00:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGz-0004Tw-Sj
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkGy-0001du-UZ
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:45 +0000
Date: Wed, 22 Jul 2015 03:00:44 +0000
Message-Id: <E1ZHkGy-0001du-UZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/hvmloader: avoid data
	corruption with xenstore reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4ee871b3854aff074d329f63186325b8f896f5b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:18:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:18:09 2015 +0200

    x86/hvmloader: avoid data corruption with xenstore reads/writes
    
    The functions ring_read and ring_write() have logic to try and deal with
    partial reads and writes.
    
    However, in all cases where the "while (len)" loop executed twice, data
    corruption would occur as the second memcpy() starts from the beginning of
    "data" again, rather than from where it got to.
    
    This bug manifested itself as protocol corruption when a reply header crossed
    the first wrap of the response ring.  However, similar corruption would also
    occur if hvmloader observed xenstored performing partial writes of the block
    in question, or if hvmloader had to wait for xenstored to make space in either
    ring.
    
    Reported-by: Adam Kucia <djexit@o2.pl>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bbbe7e7157a964c485fb861765be291734676932
    master date: 2015-07-07 14:39:27 +0200
---
 tools/firmware/hvmloader/xenbus.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index fe72e97..c513260 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -97,7 +97,7 @@ static void ring_wait(void)
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -114,16 +114,18 @@ static void ring_write(const char *data, uint32_t len)
         if ( part > len ) 
             part = len;
 
-        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod), data, part);
+        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod),
+               data + done, part);
         barrier(); /* = wmb before prod write, rmb before next cons read */
         rings->req_prod += part;
         len -= part;
+        done += part;
     }
 }
 
 static void ring_read(char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -140,10 +142,12 @@ static void ring_read(char *data, uint32_t len)
         if ( part > len )
             part = len;
 
-        memcpy(data, rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
+        memcpy(data + done,
+               rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
         barrier(); /* = wmb before cons write, rmb before next prod read */
         rings->rsp_cons += part;
         len -= part;
+        done += part;
     }
 }
 
--
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 Wed Jul 22 03:01:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03: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 1ZHkHG-0003Gy-9r; Wed, 22 Jul 2015 03:01:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHE-0003GX-Ds
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:00 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	FB/63-06739-9670FA55; Wed, 22 Jul 2015 03:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437534056!26529462!1
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 2523 invoked from network); 22 Jul 2015 03:00:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jul 2015 03:00:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHA-0004U4-33
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHA-0001eg-1W
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:56 +0000
Date: Wed, 22 Jul 2015 03:00:56 +0000
Message-Id: <E1ZHkHA-0001eg-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: earlycpio: Pull in latest
	linux earlycpio.[ch]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d55922f8b36ac4d461bc36c9496cb2b20c8c9aa2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 11:18:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:18:33 2015 +0200

    xen: earlycpio: Pull in latest linux earlycpio.[ch]
    
    AFAICT our current version does not correspond to any version in the
    Linux history. This commit resynchronised to the state in Linux
    commit 598bae70c2a8e35c8d39b610cca2b32afcf047af.
    
    Differences from upstream: find_cpio_data is __init, printk instead of
    pr_*.
    
    This appears to fix Debian bug #785187. "Appears" because my test box
    happens to be AMD and the issue is that the (valid) cpio generated by
    the Intel ucode is not liked by the old Xen code. I've tested by
    hacking the hypervisor to look for the Intel path.
    
    Reported-by: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Cc: 785187@bugs.debian.org
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 39c6664a0e6e1b4ed80660d545dff34ce41bee31
    master date: 2015-07-07 15:10:45 +0100
---
 xen/common/earlycpio.c      |   39 ++++++++++++++++++++-------------------
 xen/include/xen/earlycpio.h |    1 +
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
index 5e54142..f6b1a9e 100644
--- a/xen/common/earlycpio.c
+++ b/xen/common/earlycpio.c
@@ -54,25 +54,26 @@ enum cpio_fields {
 
 /**
  * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:   The directory to search for, including a slash at the end
- * @data:   Pointer to the the cpio archive or a header inside
- * @len:    Remaining length of the cpio based on data pointer
- * @offset: When a matching file is found, this is the offset to the
- *          beginning of the cpio. It can be used to iterate through
- *          the cpio to find all files inside of a directory path
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ * @nextoff:    When a matching file is found, this is the offset from the
+ *              beginning of the cpio to the beginning of the next file, not the
+ *              matching file itself. It can be used to iterate through the cpio
+ *              to find all files inside of a directory path.
  *
- * @return: struct cpio_data containing the address, length and
- *          filename (with the directory path cut off) of the found file.
- *          If you search for a filename and not for files in a directory,
- *          pass the absolute path of the filename in the cpio and make sure
- *          the match returned an empty filename string.
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
  */
 
 struct cpio_data __init find_cpio_data(const char *path, void *data,
-					  size_t len,  long *offset)
+				       size_t len,  long *nextoff)
 {
 	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0 };
+	struct cpio_data cd = { NULL, 0, "" };
 	const char *p, *dptr, *nptr;
 	unsigned int ch[C_NFIELDS], *chp, v;
 	unsigned char c, x;
@@ -129,17 +130,17 @@ struct cpio_data __init find_cpio_data(const char *path, void *data,
 		if ((ch[C_MODE] & 0170000) == 0100000 &&
 		    ch[C_NAMESIZE] >= mypathsize &&
 		    !memcmp(p, path, mypathsize)) {
-			*offset = (long)nptr - (long)data;
+			*nextoff = (long)nptr - (long)data;
 			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
 				printk(
 				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
 				p, MAX_CPIO_FILE_NAME);
 			}
-			if (ch[C_NAMESIZE] - 1 /* includes \0 */ == mypathsize) {
-				cd.data = (void *)dptr;
-				cd.size = ch[C_FILESIZE];
-				return cd; /* Found it! */
-			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
 		}
 		len -= (nptr - p);
 		p = nptr;
diff --git a/xen/include/xen/earlycpio.h b/xen/include/xen/earlycpio.h
index 85d144a..16d9404 100644
--- a/xen/include/xen/earlycpio.h
+++ b/xen/include/xen/earlycpio.h
@@ -6,6 +6,7 @@
 struct cpio_data {
 	void *data;
 	size_t size;
+	char name[MAX_CPIO_FILE_NAME];
 };
 
 struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
--
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 Wed Jul 22 03:01:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03: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 1ZHkHG-0003Gy-9r; Wed, 22 Jul 2015 03:01:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHE-0003GX-Ds
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:00 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	FB/63-06739-9670FA55; Wed, 22 Jul 2015 03:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437534056!26529462!1
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 2523 invoked from network); 22 Jul 2015 03:00:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jul 2015 03:00:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHA-0004U4-33
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHA-0001eg-1W
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:00:56 +0000
Date: Wed, 22 Jul 2015 03:00:56 +0000
Message-Id: <E1ZHkHA-0001eg-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: earlycpio: Pull in latest
	linux earlycpio.[ch]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d55922f8b36ac4d461bc36c9496cb2b20c8c9aa2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 11:18:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:18:33 2015 +0200

    xen: earlycpio: Pull in latest linux earlycpio.[ch]
    
    AFAICT our current version does not correspond to any version in the
    Linux history. This commit resynchronised to the state in Linux
    commit 598bae70c2a8e35c8d39b610cca2b32afcf047af.
    
    Differences from upstream: find_cpio_data is __init, printk instead of
    pr_*.
    
    This appears to fix Debian bug #785187. "Appears" because my test box
    happens to be AMD and the issue is that the (valid) cpio generated by
    the Intel ucode is not liked by the old Xen code. I've tested by
    hacking the hypervisor to look for the Intel path.
    
    Reported-by: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Cc: 785187@bugs.debian.org
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 39c6664a0e6e1b4ed80660d545dff34ce41bee31
    master date: 2015-07-07 15:10:45 +0100
---
 xen/common/earlycpio.c      |   39 ++++++++++++++++++++-------------------
 xen/include/xen/earlycpio.h |    1 +
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
index 5e54142..f6b1a9e 100644
--- a/xen/common/earlycpio.c
+++ b/xen/common/earlycpio.c
@@ -54,25 +54,26 @@ enum cpio_fields {
 
 /**
  * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:   The directory to search for, including a slash at the end
- * @data:   Pointer to the the cpio archive or a header inside
- * @len:    Remaining length of the cpio based on data pointer
- * @offset: When a matching file is found, this is the offset to the
- *          beginning of the cpio. It can be used to iterate through
- *          the cpio to find all files inside of a directory path
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ * @nextoff:    When a matching file is found, this is the offset from the
+ *              beginning of the cpio to the beginning of the next file, not the
+ *              matching file itself. It can be used to iterate through the cpio
+ *              to find all files inside of a directory path.
  *
- * @return: struct cpio_data containing the address, length and
- *          filename (with the directory path cut off) of the found file.
- *          If you search for a filename and not for files in a directory,
- *          pass the absolute path of the filename in the cpio and make sure
- *          the match returned an empty filename string.
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
  */
 
 struct cpio_data __init find_cpio_data(const char *path, void *data,
-					  size_t len,  long *offset)
+				       size_t len,  long *nextoff)
 {
 	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0 };
+	struct cpio_data cd = { NULL, 0, "" };
 	const char *p, *dptr, *nptr;
 	unsigned int ch[C_NFIELDS], *chp, v;
 	unsigned char c, x;
@@ -129,17 +130,17 @@ struct cpio_data __init find_cpio_data(const char *path, void *data,
 		if ((ch[C_MODE] & 0170000) == 0100000 &&
 		    ch[C_NAMESIZE] >= mypathsize &&
 		    !memcmp(p, path, mypathsize)) {
-			*offset = (long)nptr - (long)data;
+			*nextoff = (long)nptr - (long)data;
 			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
 				printk(
 				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
 				p, MAX_CPIO_FILE_NAME);
 			}
-			if (ch[C_NAMESIZE] - 1 /* includes \0 */ == mypathsize) {
-				cd.data = (void *)dptr;
-				cd.size = ch[C_FILESIZE];
-				return cd; /* Found it! */
-			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
 		}
 		len -= (nptr - p);
 		p = nptr;
diff --git a/xen/include/xen/earlycpio.h b/xen/include/xen/earlycpio.h
index 85d144a..16d9404 100644
--- a/xen/include/xen/earlycpio.h
+++ b/xen/include/xen/earlycpio.h
@@ -6,6 +6,7 @@
 struct cpio_data {
 	void *data;
 	size_t size;
+	char name[MAX_CPIO_FILE_NAME];
 };
 
 struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
--
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 Wed Jul 22 03:01:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:01: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 1ZHkHO-0003Ic-FE; Wed, 22 Jul 2015 03:01: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 1ZHkHN-0003IJ-2D
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:09 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	50/7F-16518-4770FA55; Wed, 22 Jul 2015 03:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437534066!25602242!1
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 9167 invoked from network); 22 Jul 2015 03:01: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;
	22 Jul 2015 03:01:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHK-0004Uf-CF
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHK-0001fn-6Y
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:06 +0000
Date: Wed, 22 Jul 2015 03:01:06 +0000
Message-Id: <E1ZHkHK-0001fn-6Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] make rangeset_report_ranges()
	report all ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1eda7e5aa0634df8e11c68a0593c38b78100c615
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 21 11:19:20 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:19:20 2015 +0200

    make rangeset_report_ranges() report all ranges
    
    find_range() returns NULL when s is below the lowest range, so we have
    to use first_range() here (which is as good performance wise), or else
    no range gets reported at all in that case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b1c780cd315eb4db06be3bbb5c6d80b1cabd27a9
    master date: 2015-07-15 16:11:42 +0200
---
 xen/common/rangeset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index f09c0c4..e205519 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -268,7 +268,7 @@ int rangeset_report_ranges(
 
     spin_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 
--
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 Wed Jul 22 03:01:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:01: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 1ZHkHO-0003Ic-FE; Wed, 22 Jul 2015 03:01: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 1ZHkHN-0003IJ-2D
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:09 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	50/7F-16518-4770FA55; Wed, 22 Jul 2015 03:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437534066!25602242!1
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 9167 invoked from network); 22 Jul 2015 03:01: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;
	22 Jul 2015 03:01:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHK-0004Uf-CF
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHK-0001fn-6Y
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:06 +0000
Date: Wed, 22 Jul 2015 03:01:06 +0000
Message-Id: <E1ZHkHK-0001fn-6Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] make rangeset_report_ranges()
	report all ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1eda7e5aa0634df8e11c68a0593c38b78100c615
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 21 11:19:20 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:19:20 2015 +0200

    make rangeset_report_ranges() report all ranges
    
    find_range() returns NULL when s is below the lowest range, so we have
    to use first_range() here (which is as good performance wise), or else
    no range gets reported at all in that case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b1c780cd315eb4db06be3bbb5c6d80b1cabd27a9
    master date: 2015-07-15 16:11:42 +0200
---
 xen/common/rangeset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index f09c0c4..e205519 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -268,7 +268,7 @@ int rangeset_report_ranges(
 
     spin_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 
--
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 Wed Jul 22 03:01:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:01: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 1ZHkHY-0003KA-Hl; Wed, 22 Jul 2015 03:01: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 1ZHkHX-0003Jy-IH
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:19 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	F8/98-03895-E770FA55; Wed, 22 Jul 2015 03:01:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1437534077!28006032!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 26285 invoked from network); 22 Jul 2015 03:01:18 -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;
	22 Jul 2015 03:01:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHV-0004Un-02
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHU-0001gF-Uu
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:16 +0000
Date: Wed, 22 Jul 2015 03:01:16 +0000
Message-Id: <E1ZHkHU-0001gF-Uu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] dmar: device scope mem leak 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 d273ce76c9d79415000d316ce7a3cad03ddb2865
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Jul 21 11:19:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:19:52 2015 +0200

    dmar: device scope mem leak fix
    
    Release memory allocated for scope.devices dmar units on various
    failure paths and when disabling dmar. Set device count after
    sucessfull memory allocation, not before, in device scope parsing function.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    # Commit 132231d10343608faf5892785a08acc500326d04
    # Date 2015-07-16 15:23:37 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    dmar: fix double free in error paths following c/s a8bc99b
    
    Several error paths would end up freeing scope->devices twice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a8bc99b981c5ad773bd646f5986e616d26fb94d7
    master date: 2015-07-16 11:50:07 +0200
    master commit: 132231d10343608faf5892785a08acc500326d04
    master date: 2015-07-16 15:23:37 +0200
---
 xen/drivers/passthrough/vtd/dmar.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 1152c3a..f5b85f2 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -80,6 +80,16 @@ static int __init acpi_register_rmrr_unit(struct acpi_rmrr_unit *rmrr)
     return 0;
 }
 
+static void scope_devices_free(struct dmar_scope *scope)
+{
+    if ( !scope )
+        return;
+
+    scope->devices_cnt = 0;
+    xfree(scope->devices);
+    scope->devices = NULL;
+}
+
 static void __init disable_all_dmar_units(void)
 {
     struct acpi_drhd_unit *drhd, *_drhd;
@@ -89,16 +99,19 @@ static void __init disable_all_dmar_units(void)
     list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list )
     {
         list_del(&drhd->list);
+        scope_devices_free(&drhd->scope);
         xfree(drhd);
     }
     list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list )
     {
         list_del(&rmrr->list);
+        scope_devices_free(&rmrr->scope);
         xfree(rmrr);
     }
     list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list )
     {
         list_del(&atsr->list);
+        scope_devices_free(&atsr->scope);
         xfree(atsr);
     }
 }
@@ -317,13 +330,13 @@ static int __init acpi_parse_dev_scope(
     if ( (cnt = scope_device_count(start, end)) < 0 )
         return cnt;
 
-    scope->devices_cnt = cnt;
     if ( cnt > 0 )
     {
         scope->devices = xzalloc_array(u16, cnt);
         if ( !scope->devices )
             return -ENOMEM;
     }
+    scope->devices_cnt = cnt;
 
     while ( start < end )
     {
@@ -426,7 +439,7 @@ static int __init acpi_parse_dev_scope(
 
  out:
     if ( ret )
-        xfree(scope->devices);
+        scope_devices_free(scope);
 
     return ret;
 }
@@ -541,6 +554,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
                     "  Workaround BIOS bug: ignore the DRHD due to all "
                     "devices under its scope are not PCI discoverable!\n");
 
+                scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
                 xfree(dmaru);
             }
@@ -561,9 +575,11 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 out:
     if ( ret )
     {
+        scope_devices_free(&dmaru->scope);
         iommu_free(dmaru);
         xfree(dmaru);
     }
+
     return ret;
 }
 
@@ -657,6 +673,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
                 "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
                 "devices under its scope are not PCI discoverable!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
@@ -664,6 +681,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
             dprintk(XENLOG_WARNING VTDPREFIX,
                 "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
         }
@@ -726,7 +744,10 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     }
 
     if ( ret )
+    {
+        scope_devices_free(&atsru->scope);
         xfree(atsru);
+    }
     else
         acpi_register_atsr_unit(atsru);
     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 Wed Jul 22 03:01:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2015 03:01: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 1ZHkHY-0003KA-Hl; Wed, 22 Jul 2015 03:01: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 1ZHkHX-0003Jy-IH
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:19 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	F8/98-03895-E770FA55; Wed, 22 Jul 2015 03:01:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1437534077!28006032!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 26285 invoked from network); 22 Jul 2015 03:01:18 -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;
	22 Jul 2015 03:01:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHV-0004Un-02
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZHkHU-0001gF-Uu
	for xen-changelog@lists.xensource.com; Wed, 22 Jul 2015 03:01:16 +0000
Date: Wed, 22 Jul 2015 03:01:16 +0000
Message-Id: <E1ZHkHU-0001gF-Uu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] dmar: device scope mem leak 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 d273ce76c9d79415000d316ce7a3cad03ddb2865
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Jul 21 11:19:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:19:52 2015 +0200

    dmar: device scope mem leak fix
    
    Release memory allocated for scope.devices dmar units on various
    failure paths and when disabling dmar. Set device count after
    sucessfull memory allocation, not before, in device scope parsing function.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    # Commit 132231d10343608faf5892785a08acc500326d04
    # Date 2015-07-16 15:23:37 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    dmar: fix double free in error paths following c/s a8bc99b
    
    Several error paths would end up freeing scope->devices twice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a8bc99b981c5ad773bd646f5986e616d26fb94d7
    master date: 2015-07-16 11:50:07 +0200
    master commit: 132231d10343608faf5892785a08acc500326d04
    master date: 2015-07-16 15:23:37 +0200
---
 xen/drivers/passthrough/vtd/dmar.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 1152c3a..f5b85f2 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -80,6 +80,16 @@ static int __init acpi_register_rmrr_unit(struct acpi_rmrr_unit *rmrr)
     return 0;
 }
 
+static void scope_devices_free(struct dmar_scope *scope)
+{
+    if ( !scope )
+        return;
+
+    scope->devices_cnt = 0;
+    xfree(scope->devices);
+    scope->devices = NULL;
+}
+
 static void __init disable_all_dmar_units(void)
 {
     struct acpi_drhd_unit *drhd, *_drhd;
@@ -89,16 +99,19 @@ static void __init disable_all_dmar_units(void)
     list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list )
     {
         list_del(&drhd->list);
+        scope_devices_free(&drhd->scope);
         xfree(drhd);
     }
     list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list )
     {
         list_del(&rmrr->list);
+        scope_devices_free(&rmrr->scope);
         xfree(rmrr);
     }
     list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list )
     {
         list_del(&atsr->list);
+        scope_devices_free(&atsr->scope);
         xfree(atsr);
     }
 }
@@ -317,13 +330,13 @@ static int __init acpi_parse_dev_scope(
     if ( (cnt = scope_device_count(start, end)) < 0 )
         return cnt;
 
-    scope->devices_cnt = cnt;
     if ( cnt > 0 )
     {
         scope->devices = xzalloc_array(u16, cnt);
         if ( !scope->devices )
             return -ENOMEM;
     }
+    scope->devices_cnt = cnt;
 
     while ( start < end )
     {
@@ -426,7 +439,7 @@ static int __init acpi_parse_dev_scope(
 
  out:
     if ( ret )
-        xfree(scope->devices);
+        scope_devices_free(scope);
 
     return ret;
 }
@@ -541,6 +554,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
                     "  Workaround BIOS bug: ignore the DRHD due to all "
                     "devices under its scope are not PCI discoverable!\n");
 
+                scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
                 xfree(dmaru);
             }
@@ -561,9 +575,11 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 out:
     if ( ret )
     {
+        scope_devices_free(&dmaru->scope);
         iommu_free(dmaru);
         xfree(dmaru);
     }
+
     return ret;
 }
 
@@ -657,6 +673,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
                 "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
                 "devices under its scope are not PCI discoverable!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
@@ -664,6 +681,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
             dprintk(XENLOG_WARNING VTDPREFIX,
                 "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
         }
@@ -726,7 +744,10 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     }
 
     if ( ret )
+    {
+        scope_devices_free(&atsru->scope);
         xfree(atsru);
+    }
     else
         acpi_register_atsr_unit(atsru);
     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 Thu Jul 23 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 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 1ZIDoL-0007nh-8v; Thu, 23 Jul 2015 10:33: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 1ZIDoJ-0007nZ-NH
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:07 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	75/C8-06457-3E2C0B55; Thu, 23 Jul 2015 10:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1437647585!27295343!1
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 2252 invoked from network); 23 Jul 2015 10:33:06 -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;
	23 Jul 2015 10:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoF-0007op-JV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoF-00068P-IL
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:03 +0000
Date: Thu, 23 Jul 2015 10:33:03 +0000
Message-Id: <E1ZIDoF-00068P-IL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] nested EPT: fix the handling of
	nested EPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96289ee3250773011a1c3dcb1f5544c93fac7820
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Tue Jul 21 11:08:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:08:05 2015 +0200

    nested EPT: fix the handling of nested EPT
    
    If the host EPT entry is changed, the nested EPT should be updated.
    the current code does not do this, and it's wrong.
    I have tested this patch, the L2 guest can boot and run as normal.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Reported-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 71bb7304e7a7a35ea6df4b0cedebc35028e4c159
    master date: 2015-06-30 15:00:54 +0100
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++++
 xen/arch/x86/mm/p2m.c     |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 15c6e83..067f7b7 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -26,6 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/nestedhvm.h>
 #include <xen/iommu.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
@@ -1040,6 +1041,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
     ASSERT(local_irq_is_enabled());
 
+    if ( nestedhvm_enabled(d) && !p2m_is_nestedp2m(p2m) )
+        p2m_flush_nestedp2m(d);
+
     /*
      * Flush active cpus synchronously. Flush others the next time this domain
      * is scheduled onto them. We accept the race of other CPUs adding to
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index efa49dd..6b9e806 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1713,6 +1713,12 @@ p2m_flush_table(struct p2m_domain *p2m)
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
 
+    if ( p2m->np2m_base == P2M_BASE_EADDR )
+    {
+        p2m_unlock(p2m);
+        return;
+    }
+
     /* This is no longer a valid nested p2m for any address space */
     p2m->np2m_base = P2M_BASE_EADDR;
     
--
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 Thu Jul 23 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 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 1ZIDoL-0007nh-8v; Thu, 23 Jul 2015 10:33: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 1ZIDoJ-0007nZ-NH
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:07 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	75/C8-06457-3E2C0B55; Thu, 23 Jul 2015 10:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1437647585!27295343!1
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 2252 invoked from network); 23 Jul 2015 10:33:06 -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;
	23 Jul 2015 10:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoF-0007op-JV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoF-00068P-IL
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:03 +0000
Date: Thu, 23 Jul 2015 10:33:03 +0000
Message-Id: <E1ZIDoF-00068P-IL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] nested EPT: fix the handling of
	nested EPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96289ee3250773011a1c3dcb1f5544c93fac7820
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Tue Jul 21 11:08:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:08:05 2015 +0200

    nested EPT: fix the handling of nested EPT
    
    If the host EPT entry is changed, the nested EPT should be updated.
    the current code does not do this, and it's wrong.
    I have tested this patch, the L2 guest can boot and run as normal.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Reported-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 71bb7304e7a7a35ea6df4b0cedebc35028e4c159
    master date: 2015-06-30 15:00:54 +0100
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++++
 xen/arch/x86/mm/p2m.c     |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 15c6e83..067f7b7 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -26,6 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/nestedhvm.h>
 #include <xen/iommu.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
@@ -1040,6 +1041,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
     ASSERT(local_irq_is_enabled());
 
+    if ( nestedhvm_enabled(d) && !p2m_is_nestedp2m(p2m) )
+        p2m_flush_nestedp2m(d);
+
     /*
      * Flush active cpus synchronously. Flush others the next time this domain
      * is scheduled onto them. We accept the race of other CPUs adding to
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index efa49dd..6b9e806 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1713,6 +1713,12 @@ p2m_flush_table(struct p2m_domain *p2m)
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
 
+    if ( p2m->np2m_base == P2M_BASE_EADDR )
+    {
+        p2m_unlock(p2m);
+        return;
+    }
+
     /* This is no longer a valid nested p2m for any address space */
     p2m->np2m_base = P2M_BASE_EADDR;
     
--
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 Thu Jul 23 10:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDoV-0007oi-BI; Thu, 23 Jul 2015 10:33: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 1ZIDoU-0007oU-5F
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:18 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C0/FA-30658-DE2C0B55; Thu, 23 Jul 2015 10:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1437647595!34508887!1
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 20871 invoked from network); 23 Jul 2015 10:33:16 -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;
	23 Jul 2015 10:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoR-0007ot-EL
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoR-00068l-BS
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:15 +0000
Date: Thu, 23 Jul 2015 10:33:15 +0000
Message-Id: <E1ZIDoR-00068l-BS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-ept: don't unmap the EPT
	pagetable while it is still in 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 4b0782fe0b3aa53ca21517af1ce06bf186c24081
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:08:57 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:08:57 2015 +0200

    x86/p2m-ept: don't unmap the EPT pagetable while it is still in use
    
    The call to iommu_pte_flush() between the two hunks uses &ept_entry->epte
    which is a pointer into the mapped page.
    
    It is eventually passed to `clflush` instruction which will suffer a pagefault
    if the virtual mapping has fallen out of the TLB.
    
        (XEN) ----[ Xen-4.5.0-xs102594-d  x86_64  debug=y  Not tainted ]----
        (XEN) CPU:    7
        (XEN) RIP:    e008:[<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        <snip>
        (XEN) Xen call trace:
        (XEN)    [<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        (XEN)    [<ffff82d08014ffff>] __iommu_flush_cache+0x4a/0x6a
        (XEN)    [<ffff82d0801532e2>] iommu_pte_flush+0x2b/0xd5
        (XEN)    [<ffff82d0801f909a>] ept_set_entry+0x4bc/0x61f
        (XEN)    [<ffff82d0801f0c25>] p2m_set_entry+0xd1/0x112
        (XEN)    [<ffff82d0801f25b1>] clear_mmio_p2m_entry+0x1a0/0x200
        (XEN)    [<ffff82d0801f4aac>] unmap_mmio_regions+0x49/0x73
        (XEN)    [<ffff82d080106292>] do_domctl+0x15bd/0x1edb
        (XEN)    [<ffff82d080234fcb>] syscall_enter+0xeb/0x145
        (XEN)
        (XEN) Pagetable walk from ffff820040004ae0:
        (XEN)  L4[0x104] = 00000008668a5063 ffffffffffffffff
        (XEN)  L3[0x001] = 00000008668a3063 ffffffffffffffff
        (XEN)  L2[0x000] = 000000086689c063 ffffffffffffffff
        (XEN)  L1[0x004] = 000000056f078063 000000000007f678
        (XEN)
        (XEN) ****************************************
        (XEN) Panic on CPU 7:
        (XEN) FATAL PAGE FAULT
        (XEN) [error_code=0000]
        (XEN) Faulting linear address: ffff820040004ae0
        (XEN) ****************************************
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e4e9d2d4e76bd8fe229c124bd57fc6ba824271b3
    master date: 2015-07-07 11:37:26 +0200
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 067f7b7..06969eb 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -764,8 +764,6 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
-    unmap_domain_page(table);
-
     if ( needs_sync != sync_off )
         ept_sync_domain(p2m);
 
@@ -788,6 +786,8 @@ out:
         }
     }
 
+    unmap_domain_page(table);
+
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
--
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 Thu Jul 23 10:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDoV-0007oi-BI; Thu, 23 Jul 2015 10:33: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 1ZIDoU-0007oU-5F
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:18 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C0/FA-30658-DE2C0B55; Thu, 23 Jul 2015 10:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1437647595!34508887!1
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 20871 invoked from network); 23 Jul 2015 10:33:16 -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;
	23 Jul 2015 10:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoR-0007ot-EL
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoR-00068l-BS
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:15 +0000
Date: Thu, 23 Jul 2015 10:33:15 +0000
Message-Id: <E1ZIDoR-00068l-BS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-ept: don't unmap the EPT
	pagetable while it is still in 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 4b0782fe0b3aa53ca21517af1ce06bf186c24081
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:08:57 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:08:57 2015 +0200

    x86/p2m-ept: don't unmap the EPT pagetable while it is still in use
    
    The call to iommu_pte_flush() between the two hunks uses &ept_entry->epte
    which is a pointer into the mapped page.
    
    It is eventually passed to `clflush` instruction which will suffer a pagefault
    if the virtual mapping has fallen out of the TLB.
    
        (XEN) ----[ Xen-4.5.0-xs102594-d  x86_64  debug=y  Not tainted ]----
        (XEN) CPU:    7
        (XEN) RIP:    e008:[<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        <snip>
        (XEN) Xen call trace:
        (XEN)    [<ffff82d0801572f0>] cacheline_flush+0x4/0x9
        (XEN)    [<ffff82d08014ffff>] __iommu_flush_cache+0x4a/0x6a
        (XEN)    [<ffff82d0801532e2>] iommu_pte_flush+0x2b/0xd5
        (XEN)    [<ffff82d0801f909a>] ept_set_entry+0x4bc/0x61f
        (XEN)    [<ffff82d0801f0c25>] p2m_set_entry+0xd1/0x112
        (XEN)    [<ffff82d0801f25b1>] clear_mmio_p2m_entry+0x1a0/0x200
        (XEN)    [<ffff82d0801f4aac>] unmap_mmio_regions+0x49/0x73
        (XEN)    [<ffff82d080106292>] do_domctl+0x15bd/0x1edb
        (XEN)    [<ffff82d080234fcb>] syscall_enter+0xeb/0x145
        (XEN)
        (XEN) Pagetable walk from ffff820040004ae0:
        (XEN)  L4[0x104] = 00000008668a5063 ffffffffffffffff
        (XEN)  L3[0x001] = 00000008668a3063 ffffffffffffffff
        (XEN)  L2[0x000] = 000000086689c063 ffffffffffffffff
        (XEN)  L1[0x004] = 000000056f078063 000000000007f678
        (XEN)
        (XEN) ****************************************
        (XEN) Panic on CPU 7:
        (XEN) FATAL PAGE FAULT
        (XEN) [error_code=0000]
        (XEN) Faulting linear address: ffff820040004ae0
        (XEN) ****************************************
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e4e9d2d4e76bd8fe229c124bd57fc6ba824271b3
    master date: 2015-07-07 11:37:26 +0200
---
 xen/arch/x86/mm/p2m-ept.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 067f7b7..06969eb 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -764,8 +764,6 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
-    unmap_domain_page(table);
-
     if ( needs_sync != sync_off )
         ept_sync_domain(p2m);
 
@@ -788,6 +786,8 @@ out:
         }
     }
 
+    unmap_domain_page(table);
+
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
--
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 Thu Jul 23 10:33:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDog-0007qh-EW; Thu, 23 Jul 2015 10:33:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoe-0007qV-IG
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:28 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	A1/D4-31258-7F2C0B55; Thu, 23 Jul 2015 10:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1437647605!34561600!1
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 5197 invoked from network); 23 Jul 2015 10:33:26 -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;
	23 Jul 2015 10:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDob-0007pE-IZ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDob-00069y-Gv
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:25 +0000
Date: Thu, 23 Jul 2015 10:33:25 +0000
Message-Id: <E1ZIDob-00069y-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86 / cpupool: clear the proper
	cpu_valid bit on pCPU teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de8b55032455a4b591f6a853fae24e474cd3835d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:09:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:09:39 2015 +0200

    x86 / cpupool: clear the proper cpu_valid bit on pCPU teardown
    
    In fact, when a pCPU goes down, we want to clear its
    bit in the correct cpupool's valid mask, rather than
    always in cpupool0's one.
    
    Before this commit, all the pCPUs in the non-default
    pool(s) will be considered immediately valid, during
    system resume, even the one that have not been brought
    up yet. As a result, the (Credit1) scheduler will attempt
    to run its load balancing logic on them, causing the
    following Oops:
    
    # xl cpupool-cpu-remove Pool-0 8-15
    # xl cpupool-create name=\"Pool-1\"
    # xl cpupool-cpu-add Pool-1 8-15
    --> suspend
    --> resume
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    8
    (XEN) RIP:    e008:[<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN) RFLAGS: 0000000000010087   CONTEXT: hypervisor
    (XEN) rax: 80007d2f7fccb780   rbx: 0000000000000009   rcx: 0000000000000000
    (XEN) rdx: ffff82d08031ed40   rsi: ffff82d080334980   rdi: 0000000000000000
    (XEN) rbp: ffff83010000fe20   rsp: ffff83010000fd40   r8:  0000000000000004
    (XEN) r9:  0000ffff0000ffff   r10: 00ff00ff00ff00ff   r11: 0f0f0f0f0f0f0f0f
    (XEN) r12: ffff8303191ea870   r13: ffff8303226aadf0   r14: 0000000000000009
    (XEN) r15: 0000000000000008   cr0: 000000008005003b   cr4: 00000000000026f0
    (XEN) cr3: 00000000dba9d000   cr2: 0000000000000000
    (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN)    [<ffff82d08012c732>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012f8c8>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012f920>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164791>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The reason why the error is a #GP fault is that, without
    this commit, we try to access the per-cpu area of a not
    yet allocated and initialized pCPU.
    In fact, %rax, which is what is used as pointer, is
    80007d2f7fccb780, and we also have this:
    
    #define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    master commit: 8022b05284dea80e24813d03180788ec7277a0bd
    master date: 2015-07-07 14:29:39 +0200
---
 xen/arch/x86/smpboot.c |    1 -
 xen/common/cpupool.c   |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index c54be7e..fe376f0 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -816,7 +816,6 @@ void __cpu_disable(void)
     remove_siblinginfo(cpu);
 
     /* It's now safe to remove this processor from the online map */
-    cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
     cpumask_clear_cpu(cpu, &cpu_online_map);
     fixup_irqs();
 
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2a557f3..045499e 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -529,6 +529,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
             if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
             {
                 cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+                cpumask_clear_cpu(cpu, (*c)->cpu_valid);
                 break;
             }
         }
@@ -551,6 +552,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
          * If we are not suspending, we are hot-unplugging cpu, and that is
          * allowed only for CPUs in pool0.
          */
+        cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
         ret = 0;
     }
 
--
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 Thu Jul 23 10:33:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDog-0007qh-EW; Thu, 23 Jul 2015 10:33:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoe-0007qV-IG
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:28 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	A1/D4-31258-7F2C0B55; Thu, 23 Jul 2015 10:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1437647605!34561600!1
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 5197 invoked from network); 23 Jul 2015 10:33:26 -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;
	23 Jul 2015 10:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDob-0007pE-IZ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDob-00069y-Gv
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:25 +0000
Date: Thu, 23 Jul 2015 10:33:25 +0000
Message-Id: <E1ZIDob-00069y-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86 / cpupool: clear the proper
	cpu_valid bit on pCPU teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de8b55032455a4b591f6a853fae24e474cd3835d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:09:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:09:39 2015 +0200

    x86 / cpupool: clear the proper cpu_valid bit on pCPU teardown
    
    In fact, when a pCPU goes down, we want to clear its
    bit in the correct cpupool's valid mask, rather than
    always in cpupool0's one.
    
    Before this commit, all the pCPUs in the non-default
    pool(s) will be considered immediately valid, during
    system resume, even the one that have not been brought
    up yet. As a result, the (Credit1) scheduler will attempt
    to run its load balancing logic on them, causing the
    following Oops:
    
    # xl cpupool-cpu-remove Pool-0 8-15
    # xl cpupool-create name=\"Pool-1\"
    # xl cpupool-cpu-add Pool-1 8-15
    --> suspend
    --> resume
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    8
    (XEN) RIP:    e008:[<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN) RFLAGS: 0000000000010087   CONTEXT: hypervisor
    (XEN) rax: 80007d2f7fccb780   rbx: 0000000000000009   rcx: 0000000000000000
    (XEN) rdx: ffff82d08031ed40   rsi: ffff82d080334980   rdi: 0000000000000000
    (XEN) rbp: ffff83010000fe20   rsp: ffff83010000fd40   r8:  0000000000000004
    (XEN) r9:  0000ffff0000ffff   r10: 00ff00ff00ff00ff   r11: 0f0f0f0f0f0f0f0f
    (XEN) r12: ffff8303191ea870   r13: ffff8303226aadf0   r14: 0000000000000009
    (XEN) r15: 0000000000000008   cr0: 000000008005003b   cr4: 00000000000026f0
    (XEN) cr3: 00000000dba9d000   cr2: 0000000000000000
    (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080123078>] csched_schedule+0x4be/0xb97
    (XEN)    [<ffff82d08012c732>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012f8c8>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012f920>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164791>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The reason why the error is a #GP fault is that, without
    this commit, we try to access the per-cpu area of a not
    yet allocated and initialized pCPU.
    In fact, %rax, which is what is used as pointer, is
    80007d2f7fccb780, and we also have this:
    
    #define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    master commit: 8022b05284dea80e24813d03180788ec7277a0bd
    master date: 2015-07-07 14:29:39 +0200
---
 xen/arch/x86/smpboot.c |    1 -
 xen/common/cpupool.c   |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index c54be7e..fe376f0 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -816,7 +816,6 @@ void __cpu_disable(void)
     remove_siblinginfo(cpu);
 
     /* It's now safe to remove this processor from the online map */
-    cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
     cpumask_clear_cpu(cpu, &cpu_online_map);
     fixup_irqs();
 
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2a557f3..045499e 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -529,6 +529,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
             if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
             {
                 cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+                cpumask_clear_cpu(cpu, (*c)->cpu_valid);
                 break;
             }
         }
@@ -551,6 +552,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
          * If we are not suspending, we are hot-unplugging cpu, and that is
          * allowed only for CPUs in pool0.
          */
+        cpumask_clear_cpu(cpu, cpupool0->cpu_valid);
         ret = 0;
     }
 
--
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 Thu Jul 23 10:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33: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 1ZIDoq-0007sL-HD; Thu, 23 Jul 2015 10:33:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoo-0007s0-EH
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:38 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	36/8B-30658-103C0B55; Thu, 23 Jul 2015 10:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437647616!26994573!1
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 27028 invoked from network); 23 Jul 2015 10:33:36 -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;
	23 Jul 2015 10:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDol-0007pM-RY
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDol-0006AT-LG
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:35 +0000
Date: Thu, 23 Jul 2015 10:33:35 +0000
Message-Id: <E1ZIDol-0006AT-LG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] credit1: properly deal with pCPUs
	not in any cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b1a3be78e2a0b61f28adf8579f23e71855fe676
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:10:11 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:10:11 2015 +0200

    credit1: properly deal with pCPUs not in any cpupool
    
    Ideally, the pCPUs that are 'free', i.e., not assigned
    to any cpupool, should not be considred by the scheduler
    for load balancing or anything. In Credit1, we fail at
    this, because of how we use cpupool_scheduler_cpumask().
    In fact, for a free pCPU, cpupool_scheduler_cpumask()
    returns a pointer to cpupool_free_cpus, and hence, near
    the top of csched_load_balance():
    
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
         goto out;
    
    is false (the pCPU _is_ free!), and we therefore do not
    jump to the end right away, as we should. This, causes
    the following splat when resuming from ACPI S3 with
    pCPUs not assigned to any pool:
    
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080122eaa>] csched_load_balance+0x213/0x794
    (XEN)    [<ffff82d08012374c>] csched_schedule+0x321/0x452
    (XEN)    [<ffff82d08012c85e>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012fa09>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012fa61>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164780>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The cure is:
     * use cpupool_online_cpumask(), as a better guard to the
       case when the cpu is being offlined;
     * explicitly check whether the cpu is free.
    
    SEDF is in a similar situation, so fix it too.
    
    Still in Credit1, we must make sure that free (or offline)
    CPUs are not considered "ticklable". Not doing so would impair
    the load balancing algorithm, making the scheduler think that
    it is possible to 'ask' the pCPU to pick up some work, while
    in reallity, that will never happen! Evidence of such behavior
    is shown in this trace:
    
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
    
        0.112998198 | ||.|| -|x||-|- d0v0 runstate_change d0v4 offline->runnable
     ]  0.112998198 | ||.|| -|x||-|- d0v0   22006(2:2:6) 1 [ f ]
     ]  0.112999612 | ||.|| -|x||-|- d0v0   28004(2:8:4) 2 [ 0 4 ]
        0.113003387 | ||.|| -||||-|x d32767v15 runstate_continue d32767v15 running->running
    
    where "22006(2:2:6) 1 [ f ]" means that pCPU 15, which is
    free from any pool, is tickled.
    
    The cure, in this case, is to filter out the free pCPUs,
    within __runq_tickle().
    
    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>
    master commit: 02ea5031825d984d52eb9a982b8457e3434137f0
    master date: 2015-07-07 14:30:06 +0200
---
 xen/common/sched_credit.c |   23 ++++++++++++++++-------
 xen/common/sched_sedf.c   |    3 ++-
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 8b02b7b..d7ec1db 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -350,12 +350,17 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask, idle_mask;
+    cpumask_t mask, idle_mask, *online;
     int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-    idlers_empty = cpumask_empty(prv->idlers);
+
+    /* cpu is vc->processor, so it must be in a cpupool. */
+    ASSERT(per_cpu(cpupool, cpu) != NULL);
+    online = cpupool_online_cpumask(per_cpu(cpupool, cpu));
+    cpumask_and(&idle_mask, prv->idlers, online);
+    idlers_empty = cpumask_empty(&idle_mask);
 
 
     /*
@@ -392,8 +397,8 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
             /* Are there idlers suitable for new (for this balance step)? */
             csched_balance_cpumask(new->vcpu, balance_step,
                                    csched_balance_mask);
-            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
-            new_idlers_empty = cpumask_empty(&idle_mask);
+            cpumask_and(csched_balance_mask, csched_balance_mask, &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask);
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1494,6 +1499,7 @@ static struct csched_vcpu *
 csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *snext, bool_t *stolen)
 {
+    struct cpupool *c = per_cpu(cpupool, cpu);
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
@@ -1501,10 +1507,13 @@ csched_load_balance(struct csched_private *prv, int cpu,
     int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
+    online = cpupool_online_cpumask(c);
 
-    /* If this CPU is going offline we shouldn't steal work. */
-    if ( unlikely(!cpumask_test_cpu(cpu, online)) )
+    /*
+     * If this CPU is going offline, or is not (yet) part of any cpupool
+     * (as it happens, e.g., during cpu bringup), we shouldn't steal work.
+     */
+    if ( unlikely(!cpumask_test_cpu(cpu, online) || c == NULL) )
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 7c80bad..23eaa52 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -791,7 +791,8 @@ static struct task_slice sedf_do_schedule(
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu,
-                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
+                   cpupool_online_cpumask(per_cpu(cpupool, cpu))) ||
+                  per_cpu(cpupool, cpu) == NULL) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
--
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 Thu Jul 23 10:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33: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 1ZIDoq-0007sL-HD; Thu, 23 Jul 2015 10:33:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDoo-0007s0-EH
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:38 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	36/8B-30658-103C0B55; Thu, 23 Jul 2015 10:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437647616!26994573!1
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 27028 invoked from network); 23 Jul 2015 10:33:36 -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;
	23 Jul 2015 10:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDol-0007pM-RY
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDol-0006AT-LG
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:35 +0000
Date: Thu, 23 Jul 2015 10:33:35 +0000
Message-Id: <E1ZIDol-0006AT-LG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] credit1: properly deal with pCPUs
	not in any cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b1a3be78e2a0b61f28adf8579f23e71855fe676
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 11:10:11 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:10:11 2015 +0200

    credit1: properly deal with pCPUs not in any cpupool
    
    Ideally, the pCPUs that are 'free', i.e., not assigned
    to any cpupool, should not be considred by the scheduler
    for load balancing or anything. In Credit1, we fail at
    this, because of how we use cpupool_scheduler_cpumask().
    In fact, for a free pCPU, cpupool_scheduler_cpumask()
    returns a pointer to cpupool_free_cpus, and hence, near
    the top of csched_load_balance():
    
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
         goto out;
    
    is false (the pCPU _is_ free!), and we therefore do not
    jump to the end right away, as we should. This, causes
    the following splat when resuming from ACPI S3 with
    pCPUs not assigned to any pool:
    
    (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d080122eaa>] csched_load_balance+0x213/0x794
    (XEN)    [<ffff82d08012374c>] csched_schedule+0x321/0x452
    (XEN)    [<ffff82d08012c85e>] schedule+0x12a/0x63c
    (XEN)    [<ffff82d08012fa09>] __do_softirq+0x82/0x8d
    (XEN)    [<ffff82d08012fa61>] do_softirq+0x13/0x15
    (XEN)    [<ffff82d080164780>] idle_loop+0x5b/0x6b
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 8:
    (XEN) GENERAL PROTECTION FAULT
    (XEN) [error_code=0000]
    (XEN) ****************************************
    
    The cure is:
     * use cpupool_online_cpumask(), as a better guard to the
       case when the cpu is being offlined;
     * explicitly check whether the cpu is free.
    
    SEDF is in a similar situation, so fix it too.
    
    Still in Credit1, we must make sure that free (or offline)
    CPUs are not considered "ticklable". Not doing so would impair
    the load balancing algorithm, making the scheduler think that
    it is possible to 'ask' the pCPU to pick up some work, while
    in reallity, that will never happen! Evidence of such behavior
    is shown in this trace:
    
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
    
        0.112998198 | ||.|| -|x||-|- d0v0 runstate_change d0v4 offline->runnable
     ]  0.112998198 | ||.|| -|x||-|- d0v0   22006(2:2:6) 1 [ f ]
     ]  0.112999612 | ||.|| -|x||-|- d0v0   28004(2:8:4) 2 [ 0 4 ]
        0.113003387 | ||.|| -||||-|x d32767v15 runstate_continue d32767v15 running->running
    
    where "22006(2:2:6) 1 [ f ]" means that pCPU 15, which is
    free from any pool, is tickled.
    
    The cure, in this case, is to filter out the free pCPUs,
    within __runq_tickle().
    
    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>
    master commit: 02ea5031825d984d52eb9a982b8457e3434137f0
    master date: 2015-07-07 14:30:06 +0200
---
 xen/common/sched_credit.c |   23 ++++++++++++++++-------
 xen/common/sched_sedf.c   |    3 ++-
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 8b02b7b..d7ec1db 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -350,12 +350,17 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask, idle_mask;
+    cpumask_t mask, idle_mask, *online;
     int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-    idlers_empty = cpumask_empty(prv->idlers);
+
+    /* cpu is vc->processor, so it must be in a cpupool. */
+    ASSERT(per_cpu(cpupool, cpu) != NULL);
+    online = cpupool_online_cpumask(per_cpu(cpupool, cpu));
+    cpumask_and(&idle_mask, prv->idlers, online);
+    idlers_empty = cpumask_empty(&idle_mask);
 
 
     /*
@@ -392,8 +397,8 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
             /* Are there idlers suitable for new (for this balance step)? */
             csched_balance_cpumask(new->vcpu, balance_step,
                                    csched_balance_mask);
-            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
-            new_idlers_empty = cpumask_empty(&idle_mask);
+            cpumask_and(csched_balance_mask, csched_balance_mask, &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask);
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1494,6 +1499,7 @@ static struct csched_vcpu *
 csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *snext, bool_t *stolen)
 {
+    struct cpupool *c = per_cpu(cpupool, cpu);
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
@@ -1501,10 +1507,13 @@ csched_load_balance(struct csched_private *prv, int cpu,
     int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
+    online = cpupool_online_cpumask(c);
 
-    /* If this CPU is going offline we shouldn't steal work. */
-    if ( unlikely(!cpumask_test_cpu(cpu, online)) )
+    /*
+     * If this CPU is going offline, or is not (yet) part of any cpupool
+     * (as it happens, e.g., during cpu bringup), we shouldn't steal work.
+     */
+    if ( unlikely(!cpumask_test_cpu(cpu, online) || c == NULL) )
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 7c80bad..23eaa52 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -791,7 +791,8 @@ static struct task_slice sedf_do_schedule(
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu,
-                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
+                   cpupool_online_cpumask(per_cpu(cpupool, cpu))) ||
+                  per_cpu(cpupool, cpu) == NULL) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
--
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 Thu Jul 23 10:33:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33: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 1ZIDoz-0007u1-Jh; Thu, 23 Jul 2015 10:33: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 1ZIDoy-0007th-99
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:48 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D2/4D-12200-B03C0B55; Thu, 23 Jul 2015 10:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1437647626!23109016!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 31895 invoked from network); 23 Jul 2015 10:33:47 -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;
	23 Jul 2015 10:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDov-0007pU-Vc
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDov-0006As-U0
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:45 +0000
Date: Thu, 23 Jul 2015 10:33:45 +0000
Message-Id: <E1ZIDov-0006As-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/hvmloader: avoid data
	corruption with xenstore reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c166421b0af090813ad2cc691fad24784feaf1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:11:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:11:19 2015 +0200

    x86/hvmloader: avoid data corruption with xenstore reads/writes
    
    The functions ring_read and ring_write() have logic to try and deal with
    partial reads and writes.
    
    However, in all cases where the "while (len)" loop executed twice, data
    corruption would occur as the second memcpy() starts from the beginning of
    "data" again, rather than from where it got to.
    
    This bug manifested itself as protocol corruption when a reply header crossed
    the first wrap of the response ring.  However, similar corruption would also
    occur if hvmloader observed xenstored performing partial writes of the block
    in question, or if hvmloader had to wait for xenstored to make space in either
    ring.
    
    Reported-by: Adam Kucia <djexit@o2.pl>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bbbe7e7157a964c485fb861765be291734676932
    master date: 2015-07-07 14:39:27 +0200
---
 tools/firmware/hvmloader/xenbus.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index f900a1e..00513f7 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -105,7 +105,7 @@ void xenbus_shutdown(void)
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -122,16 +122,18 @@ static void ring_write(const char *data, uint32_t len)
         if ( part > len ) 
             part = len;
 
-        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod), data, part);
+        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod),
+               data + done, part);
         barrier(); /* = wmb before prod write, rmb before next cons read */
         rings->req_prod += part;
         len -= part;
+        done += part;
     }
 }
 
 static void ring_read(char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -148,10 +150,12 @@ static void ring_read(char *data, uint32_t len)
         if ( part > len )
             part = len;
 
-        memcpy(data, rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
+        memcpy(data + done,
+               rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
         barrier(); /* = wmb before cons write, rmb before next prod read */
         rings->rsp_cons += part;
         len -= part;
+        done += part;
     }
 }
 
--
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 Thu Jul 23 10:33:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:33: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 1ZIDoz-0007u1-Jh; Thu, 23 Jul 2015 10:33: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 1ZIDoy-0007th-99
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:48 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D2/4D-12200-B03C0B55; Thu, 23 Jul 2015 10:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1437647626!23109016!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 31895 invoked from network); 23 Jul 2015 10:33:47 -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;
	23 Jul 2015 10:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDov-0007pU-Vc
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDov-0006As-U0
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:45 +0000
Date: Thu, 23 Jul 2015 10:33:45 +0000
Message-Id: <E1ZIDov-0006As-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/hvmloader: avoid data
	corruption with xenstore reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c166421b0af090813ad2cc691fad24784feaf1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 21 11:11:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:11:19 2015 +0200

    x86/hvmloader: avoid data corruption with xenstore reads/writes
    
    The functions ring_read and ring_write() have logic to try and deal with
    partial reads and writes.
    
    However, in all cases where the "while (len)" loop executed twice, data
    corruption would occur as the second memcpy() starts from the beginning of
    "data" again, rather than from where it got to.
    
    This bug manifested itself as protocol corruption when a reply header crossed
    the first wrap of the response ring.  However, similar corruption would also
    occur if hvmloader observed xenstored performing partial writes of the block
    in question, or if hvmloader had to wait for xenstored to make space in either
    ring.
    
    Reported-by: Adam Kucia <djexit@o2.pl>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bbbe7e7157a964c485fb861765be291734676932
    master date: 2015-07-07 14:39:27 +0200
---
 tools/firmware/hvmloader/xenbus.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index f900a1e..00513f7 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -105,7 +105,7 @@ void xenbus_shutdown(void)
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -122,16 +122,18 @@ static void ring_write(const char *data, uint32_t len)
         if ( part > len ) 
             part = len;
 
-        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod), data, part);
+        memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod),
+               data + done, part);
         barrier(); /* = wmb before prod write, rmb before next cons read */
         rings->req_prod += part;
         len -= part;
+        done += part;
     }
 }
 
 static void ring_read(char *data, uint32_t len)
 {
-    uint32_t part;
+    uint32_t part, done = 0;
 
     ASSERT(len <= XENSTORE_PAYLOAD_MAX);
 
@@ -148,10 +150,12 @@ static void ring_read(char *data, uint32_t len)
         if ( part > len )
             part = len;
 
-        memcpy(data, rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
+        memcpy(data + done,
+               rings->rsp + MASK_XENSTORE_IDX(rings->rsp_cons), part);
         barrier(); /* = wmb before cons write, rmb before next prod read */
         rings->rsp_cons += part;
         len -= part;
+        done += part;
     }
 }
 
--
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 Thu Jul 23 10:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpA-0007w7-ME; Thu, 23 Jul 2015 10:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp8-0007vk-I0
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:58 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	09/A1-27535-513C0B55; Thu, 23 Jul 2015 10:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1437647636!23153923!1
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 14164 invoked from network); 23 Jul 2015 10:33:57 -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;
	23 Jul 2015 10:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp6-0007pc-2m
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp6-0006BE-1r
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:56 +0000
Date: Thu, 23 Jul 2015 10:33:56 +0000
Message-Id: <E1ZIDp6-0006BE-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: earlycpio: Pull in latest
	linux earlycpio.[ch]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf423e947a9324801475956a4c3d7cc259f72e03
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 11:11:49 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:11:49 2015 +0200

    xen: earlycpio: Pull in latest linux earlycpio.[ch]
    
    AFAICT our current version does not correspond to any version in the
    Linux history. This commit resynchronised to the state in Linux
    commit 598bae70c2a8e35c8d39b610cca2b32afcf047af.
    
    Differences from upstream: find_cpio_data is __init, printk instead of
    pr_*.
    
    This appears to fix Debian bug #785187. "Appears" because my test box
    happens to be AMD and the issue is that the (valid) cpio generated by
    the Intel ucode is not liked by the old Xen code. I've tested by
    hacking the hypervisor to look for the Intel path.
    
    Reported-by: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Cc: 785187@bugs.debian.org
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 39c6664a0e6e1b4ed80660d545dff34ce41bee31
    master date: 2015-07-07 15:10:45 +0100
---
 xen/common/earlycpio.c      |   39 ++++++++++++++++++++-------------------
 xen/include/xen/earlycpio.h |    1 +
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
index 5e54142..f6b1a9e 100644
--- a/xen/common/earlycpio.c
+++ b/xen/common/earlycpio.c
@@ -54,25 +54,26 @@ enum cpio_fields {
 
 /**
  * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:   The directory to search for, including a slash at the end
- * @data:   Pointer to the the cpio archive or a header inside
- * @len:    Remaining length of the cpio based on data pointer
- * @offset: When a matching file is found, this is the offset to the
- *          beginning of the cpio. It can be used to iterate through
- *          the cpio to find all files inside of a directory path
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ * @nextoff:    When a matching file is found, this is the offset from the
+ *              beginning of the cpio to the beginning of the next file, not the
+ *              matching file itself. It can be used to iterate through the cpio
+ *              to find all files inside of a directory path.
  *
- * @return: struct cpio_data containing the address, length and
- *          filename (with the directory path cut off) of the found file.
- *          If you search for a filename and not for files in a directory,
- *          pass the absolute path of the filename in the cpio and make sure
- *          the match returned an empty filename string.
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
  */
 
 struct cpio_data __init find_cpio_data(const char *path, void *data,
-					  size_t len,  long *offset)
+				       size_t len,  long *nextoff)
 {
 	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0 };
+	struct cpio_data cd = { NULL, 0, "" };
 	const char *p, *dptr, *nptr;
 	unsigned int ch[C_NFIELDS], *chp, v;
 	unsigned char c, x;
@@ -129,17 +130,17 @@ struct cpio_data __init find_cpio_data(const char *path, void *data,
 		if ((ch[C_MODE] & 0170000) == 0100000 &&
 		    ch[C_NAMESIZE] >= mypathsize &&
 		    !memcmp(p, path, mypathsize)) {
-			*offset = (long)nptr - (long)data;
+			*nextoff = (long)nptr - (long)data;
 			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
 				printk(
 				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
 				p, MAX_CPIO_FILE_NAME);
 			}
-			if (ch[C_NAMESIZE] - 1 /* includes \0 */ == mypathsize) {
-				cd.data = (void *)dptr;
-				cd.size = ch[C_FILESIZE];
-				return cd; /* Found it! */
-			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
 		}
 		len -= (nptr - p);
 		p = nptr;
diff --git a/xen/include/xen/earlycpio.h b/xen/include/xen/earlycpio.h
index 85d144a..16d9404 100644
--- a/xen/include/xen/earlycpio.h
+++ b/xen/include/xen/earlycpio.h
@@ -6,6 +6,7 @@
 struct cpio_data {
 	void *data;
 	size_t size;
+	char name[MAX_CPIO_FILE_NAME];
 };
 
 struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
--
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 Thu Jul 23 10:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpA-0007w7-ME; Thu, 23 Jul 2015 10:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp8-0007vk-I0
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:58 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	09/A1-27535-513C0B55; Thu, 23 Jul 2015 10:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1437647636!23153923!1
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 14164 invoked from network); 23 Jul 2015 10:33:57 -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;
	23 Jul 2015 10:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp6-0007pc-2m
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDp6-0006BE-1r
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:33:56 +0000
Date: Thu, 23 Jul 2015 10:33:56 +0000
Message-Id: <E1ZIDp6-0006BE-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: earlycpio: Pull in latest
	linux earlycpio.[ch]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf423e947a9324801475956a4c3d7cc259f72e03
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 11:11:49 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:11:49 2015 +0200

    xen: earlycpio: Pull in latest linux earlycpio.[ch]
    
    AFAICT our current version does not correspond to any version in the
    Linux history. This commit resynchronised to the state in Linux
    commit 598bae70c2a8e35c8d39b610cca2b32afcf047af.
    
    Differences from upstream: find_cpio_data is __init, printk instead of
    pr_*.
    
    This appears to fix Debian bug #785187. "Appears" because my test box
    happens to be AMD and the issue is that the (valid) cpio generated by
    the Intel ucode is not liked by the old Xen code. I've tested by
    hacking the hypervisor to look for the Intel path.
    
    Reported-by: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
    Cc: 785187@bugs.debian.org
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 39c6664a0e6e1b4ed80660d545dff34ce41bee31
    master date: 2015-07-07 15:10:45 +0100
---
 xen/common/earlycpio.c      |   39 ++++++++++++++++++++-------------------
 xen/include/xen/earlycpio.h |    1 +
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
index 5e54142..f6b1a9e 100644
--- a/xen/common/earlycpio.c
+++ b/xen/common/earlycpio.c
@@ -54,25 +54,26 @@ enum cpio_fields {
 
 /**
  * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:   The directory to search for, including a slash at the end
- * @data:   Pointer to the the cpio archive or a header inside
- * @len:    Remaining length of the cpio based on data pointer
- * @offset: When a matching file is found, this is the offset to the
- *          beginning of the cpio. It can be used to iterate through
- *          the cpio to find all files inside of a directory path
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ * @nextoff:    When a matching file is found, this is the offset from the
+ *              beginning of the cpio to the beginning of the next file, not the
+ *              matching file itself. It can be used to iterate through the cpio
+ *              to find all files inside of a directory path.
  *
- * @return: struct cpio_data containing the address, length and
- *          filename (with the directory path cut off) of the found file.
- *          If you search for a filename and not for files in a directory,
- *          pass the absolute path of the filename in the cpio and make sure
- *          the match returned an empty filename string.
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
  */
 
 struct cpio_data __init find_cpio_data(const char *path, void *data,
-					  size_t len,  long *offset)
+				       size_t len,  long *nextoff)
 {
 	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0 };
+	struct cpio_data cd = { NULL, 0, "" };
 	const char *p, *dptr, *nptr;
 	unsigned int ch[C_NFIELDS], *chp, v;
 	unsigned char c, x;
@@ -129,17 +130,17 @@ struct cpio_data __init find_cpio_data(const char *path, void *data,
 		if ((ch[C_MODE] & 0170000) == 0100000 &&
 		    ch[C_NAMESIZE] >= mypathsize &&
 		    !memcmp(p, path, mypathsize)) {
-			*offset = (long)nptr - (long)data;
+			*nextoff = (long)nptr - (long)data;
 			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
 				printk(
 				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
 				p, MAX_CPIO_FILE_NAME);
 			}
-			if (ch[C_NAMESIZE] - 1 /* includes \0 */ == mypathsize) {
-				cd.data = (void *)dptr;
-				cd.size = ch[C_FILESIZE];
-				return cd; /* Found it! */
-			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
 		}
 		len -= (nptr - p);
 		p = nptr;
diff --git a/xen/include/xen/earlycpio.h b/xen/include/xen/earlycpio.h
index 85d144a..16d9404 100644
--- a/xen/include/xen/earlycpio.h
+++ b/xen/include/xen/earlycpio.h
@@ -6,6 +6,7 @@
 struct cpio_data {
 	void *data;
 	size_t size;
+	char name[MAX_CPIO_FILE_NAME];
 };
 
 struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
--
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 Thu Jul 23 10:34:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpJ-0007xw-Qi; Thu, 23 Jul 2015 10:34: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 1ZIDpI-0007xh-Iv
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:08 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4C/EC-21557-F13C0B55; Thu, 23 Jul 2015 10:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1437647646!7422617!1
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 12669 invoked from network); 23 Jul 2015 10:34:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:34:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpG-0007qC-6o
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpG-0006Bz-5q
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:06 +0000
Date: Thu, 23 Jul 2015 10:34:06 +0000
Message-Id: <E1ZIDpG-0006Bz-5q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] make rangeset_report_ranges()
	report all ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa885a0c03ef8a2d26da0413de7d98382e496096
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 21 11:12:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:12:35 2015 +0200

    make rangeset_report_ranges() report all ranges
    
    find_range() returns NULL when s is below the lowest range, so we have
    to use first_range() here (which is as good performance wise), or else
    no range gets reported at all in that case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b1c780cd315eb4db06be3bbb5c6d80b1cabd27a9
    master date: 2015-07-15 16:11:42 +0200
---
 xen/common/rangeset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index 116d5dc..d8f009e 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -289,7 +289,7 @@ int rangeset_report_ranges(
 
     read_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 
--
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 Thu Jul 23 10:34:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpJ-0007xw-Qi; Thu, 23 Jul 2015 10:34: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 1ZIDpI-0007xh-Iv
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:08 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4C/EC-21557-F13C0B55; Thu, 23 Jul 2015 10:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1437647646!7422617!1
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 12669 invoked from network); 23 Jul 2015 10:34:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:34:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpG-0007qC-6o
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpG-0006Bz-5q
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:06 +0000
Date: Thu, 23 Jul 2015 10:34:06 +0000
Message-Id: <E1ZIDpG-0006Bz-5q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] make rangeset_report_ranges()
	report all ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa885a0c03ef8a2d26da0413de7d98382e496096
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 21 11:12:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:12:35 2015 +0200

    make rangeset_report_ranges() report all ranges
    
    find_range() returns NULL when s is below the lowest range, so we have
    to use first_range() here (which is as good performance wise), or else
    no range gets reported at all in that case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b1c780cd315eb4db06be3bbb5c6d80b1cabd27a9
    master date: 2015-07-15 16:11:42 +0200
---
 xen/common/rangeset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index 116d5dc..d8f009e 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -289,7 +289,7 @@ int rangeset_report_ranges(
 
     read_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 
--
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 Thu Jul 23 10:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpT-0007zd-TP; Thu, 23 Jul 2015 10:34: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 1ZIDpT-0007zR-57
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:19 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	2F/CC-30658-A23C0B55; Thu, 23 Jul 2015 10:34:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437647656!26994815!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 980 invoked from network); 23 Jul 2015 10:34:17 -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;
	23 Jul 2015 10:34:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpQ-0007qK-AJ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpQ-0006CL-9P
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:16 +0000
Date: Thu, 23 Jul 2015 10:34:16 +0000
Message-Id: <E1ZIDpQ-0006CL-9P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] dmar: device scope mem leak 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 666b80f239c566283cb1b3435180d99a329d0156
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Jul 21 11:13:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:13:03 2015 +0200

    dmar: device scope mem leak fix
    
    Release memory allocated for scope.devices dmar units on various
    failure paths and when disabling dmar. Set device count after
    sucessfull memory allocation, not before, in device scope parsing function.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    # Commit 132231d10343608faf5892785a08acc500326d04
    # Date 2015-07-16 15:23:37 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    dmar: fix double free in error paths following c/s a8bc99b
    
    Several error paths would end up freeing scope->devices twice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a8bc99b981c5ad773bd646f5986e616d26fb94d7
    master date: 2015-07-16 11:50:07 +0200
    master commit: 132231d10343608faf5892785a08acc500326d04
    master date: 2015-07-16 15:23:37 +0200
---
 xen/drivers/passthrough/vtd/dmar.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 1152c3a..f5b85f2 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -80,6 +80,16 @@ static int __init acpi_register_rmrr_unit(struct acpi_rmrr_unit *rmrr)
     return 0;
 }
 
+static void scope_devices_free(struct dmar_scope *scope)
+{
+    if ( !scope )
+        return;
+
+    scope->devices_cnt = 0;
+    xfree(scope->devices);
+    scope->devices = NULL;
+}
+
 static void __init disable_all_dmar_units(void)
 {
     struct acpi_drhd_unit *drhd, *_drhd;
@@ -89,16 +99,19 @@ static void __init disable_all_dmar_units(void)
     list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list )
     {
         list_del(&drhd->list);
+        scope_devices_free(&drhd->scope);
         xfree(drhd);
     }
     list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list )
     {
         list_del(&rmrr->list);
+        scope_devices_free(&rmrr->scope);
         xfree(rmrr);
     }
     list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list )
     {
         list_del(&atsr->list);
+        scope_devices_free(&atsr->scope);
         xfree(atsr);
     }
 }
@@ -317,13 +330,13 @@ static int __init acpi_parse_dev_scope(
     if ( (cnt = scope_device_count(start, end)) < 0 )
         return cnt;
 
-    scope->devices_cnt = cnt;
     if ( cnt > 0 )
     {
         scope->devices = xzalloc_array(u16, cnt);
         if ( !scope->devices )
             return -ENOMEM;
     }
+    scope->devices_cnt = cnt;
 
     while ( start < end )
     {
@@ -426,7 +439,7 @@ static int __init acpi_parse_dev_scope(
 
  out:
     if ( ret )
-        xfree(scope->devices);
+        scope_devices_free(scope);
 
     return ret;
 }
@@ -541,6 +554,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
                     "  Workaround BIOS bug: ignore the DRHD due to all "
                     "devices under its scope are not PCI discoverable!\n");
 
+                scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
                 xfree(dmaru);
             }
@@ -561,9 +575,11 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 out:
     if ( ret )
     {
+        scope_devices_free(&dmaru->scope);
         iommu_free(dmaru);
         xfree(dmaru);
     }
+
     return ret;
 }
 
@@ -657,6 +673,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
                 "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
                 "devices under its scope are not PCI discoverable!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
@@ -664,6 +681,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
             dprintk(XENLOG_WARNING VTDPREFIX,
                 "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
         }
@@ -726,7 +744,10 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     }
 
     if ( ret )
+    {
+        scope_devices_free(&atsru->scope);
         xfree(atsru);
+    }
     else
         acpi_register_atsr_unit(atsru);
     return ret;
--
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 Thu Jul 23 10:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:34: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 1ZIDpT-0007zd-TP; Thu, 23 Jul 2015 10:34: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 1ZIDpT-0007zR-57
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:19 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	2F/CC-30658-A23C0B55; Thu, 23 Jul 2015 10:34:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1437647656!26994815!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 980 invoked from network); 23 Jul 2015 10:34:17 -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;
	23 Jul 2015 10:34:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpQ-0007qK-AJ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDpQ-0006CL-9P
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:34:16 +0000
Date: Thu, 23 Jul 2015 10:34:16 +0000
Message-Id: <E1ZIDpQ-0006CL-9P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] dmar: device scope mem leak 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 666b80f239c566283cb1b3435180d99a329d0156
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Jul 21 11:13:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 21 11:13:03 2015 +0200

    dmar: device scope mem leak fix
    
    Release memory allocated for scope.devices dmar units on various
    failure paths and when disabling dmar. Set device count after
    sucessfull memory allocation, not before, in device scope parsing function.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    # Commit 132231d10343608faf5892785a08acc500326d04
    # Date 2015-07-16 15:23:37 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    dmar: fix double free in error paths following c/s a8bc99b
    
    Several error paths would end up freeing scope->devices twice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a8bc99b981c5ad773bd646f5986e616d26fb94d7
    master date: 2015-07-16 11:50:07 +0200
    master commit: 132231d10343608faf5892785a08acc500326d04
    master date: 2015-07-16 15:23:37 +0200
---
 xen/drivers/passthrough/vtd/dmar.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 1152c3a..f5b85f2 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -80,6 +80,16 @@ static int __init acpi_register_rmrr_unit(struct acpi_rmrr_unit *rmrr)
     return 0;
 }
 
+static void scope_devices_free(struct dmar_scope *scope)
+{
+    if ( !scope )
+        return;
+
+    scope->devices_cnt = 0;
+    xfree(scope->devices);
+    scope->devices = NULL;
+}
+
 static void __init disable_all_dmar_units(void)
 {
     struct acpi_drhd_unit *drhd, *_drhd;
@@ -89,16 +99,19 @@ static void __init disable_all_dmar_units(void)
     list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list )
     {
         list_del(&drhd->list);
+        scope_devices_free(&drhd->scope);
         xfree(drhd);
     }
     list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list )
     {
         list_del(&rmrr->list);
+        scope_devices_free(&rmrr->scope);
         xfree(rmrr);
     }
     list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list )
     {
         list_del(&atsr->list);
+        scope_devices_free(&atsr->scope);
         xfree(atsr);
     }
 }
@@ -317,13 +330,13 @@ static int __init acpi_parse_dev_scope(
     if ( (cnt = scope_device_count(start, end)) < 0 )
         return cnt;
 
-    scope->devices_cnt = cnt;
     if ( cnt > 0 )
     {
         scope->devices = xzalloc_array(u16, cnt);
         if ( !scope->devices )
             return -ENOMEM;
     }
+    scope->devices_cnt = cnt;
 
     while ( start < end )
     {
@@ -426,7 +439,7 @@ static int __init acpi_parse_dev_scope(
 
  out:
     if ( ret )
-        xfree(scope->devices);
+        scope_devices_free(scope);
 
     return ret;
 }
@@ -541,6 +554,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
                     "  Workaround BIOS bug: ignore the DRHD due to all "
                     "devices under its scope are not PCI discoverable!\n");
 
+                scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
                 xfree(dmaru);
             }
@@ -561,9 +575,11 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 out:
     if ( ret )
     {
+        scope_devices_free(&dmaru->scope);
         iommu_free(dmaru);
         xfree(dmaru);
     }
+
     return ret;
 }
 
@@ -657,6 +673,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
                 "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
                 "devices under its scope are not PCI discoverable!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
@@ -664,6 +681,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
             dprintk(XENLOG_WARNING VTDPREFIX,
                 "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
                 rmrru->base_address, rmrru->end_address);
+            scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
         }
@@ -726,7 +744,10 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     }
 
     if ( ret )
+    {
+        scope_devices_free(&atsru->scope);
         xfree(atsru);
+    }
     else
         acpi_register_atsr_unit(atsru);
     return ret;
--
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 Thu Jul 23 10:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIDz1-0000rn-CV; Thu, 23 Jul 2015 10:44: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 1ZIDyz-0000rf-Q6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	8C/A8-01068-975C0B55; Thu, 23 Jul 2015 10:44:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437648244!26126807!1
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 26248 invoked from network); 23 Jul 2015 10:44:05 -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;
	23 Jul 2015 10:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDyu-0007vn-2X
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDyt-0006zj-NA
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:03 +0000
Date: Thu, 23 Jul 2015 10:44:03 +0000
Message-Id: <E1ZIDyt-0006zj-NA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: rename
	libxl__domain_suspend to libxl__domain_save
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73db059d35ed48d8ae5ba0d9d9323a15c3d47907
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Wed Jun 3 10:57:28 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:13 2015 +0100

    tools/libxl: rename libxl__domain_suspend to libxl__domain_save
    
    The suspend/save terminology used by libxc is more consistent.
    "suspend" refers to quiescing the VM, so pausing qemu, making a
    remote_shutdown(SHUTDOWN_suspend) hypercall etc.
    "save" refers to the actions involved in actually shuffling the
    state of the VM, so xc_domain_save() etc.
    
    libxl currently uses "suspend" to encapsulate both. The patch
    Rename libxl__domain_suspend() to libxl__domain_save() since it
    actually refers to shuffling the state of the VM.
    
    This results in some strangeness in that some functions called *save*
    are now passed a struct called *suspend*, this is temporary and is all
    fixed up later by the refactoring of the suspend_state.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Some comments, commit messages:
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c          |    4 ++--
 tools/libxl/libxl_dom.c      |   16 ++++++++--------
 tools/libxl/libxl_internal.h |   13 ++++++++++---
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3fe1b99..dbbce17 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -921,7 +921,7 @@ static void libxl__remus_setup_done(libxl__egc *egc,
     STATE_AO_GC(dss->ao);
 
     if (!rc) {
-        libxl__domain_suspend(egc, dss);
+        libxl__domain_save(egc, dss);
         return;
     }
 
@@ -988,7 +988,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
     dss->live = flags & LIBXL_SUSPEND_LIVE;
     dss->debug = flags & LIBXL_SUSPEND_DEBUG;
 
-    libxl__domain_suspend(egc, dss);
+    libxl__domain_save(egc, dss);
     return AO_INPROGRESS;
 
  out_err:
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 4cb247a..ddd94bf 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1155,8 +1155,8 @@ out:
 
 static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc);
-static void domain_suspend_done(libxl__egc *egc,
-                        libxl__domain_suspend_state *dss, int rc);
+static void domain_save_done(libxl__egc *egc,
+                             libxl__domain_suspend_state *dss, int rc);
 static void domain_suspend_callback_common_done(libxl__egc *egc,
                                 libxl__domain_suspend_state *dss, int rc);
 
@@ -2039,9 +2039,9 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
     libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
 }
 
-/*----- main code for suspending, in order of execution -----*/
+/*----- main code for saving, in order of execution -----*/
 
-void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss)
+void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
 {
     STATE_AO_GC(dss->ao);
     int port;
@@ -2128,13 +2128,13 @@ void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss)
     return;
 
  out:
-    domain_suspend_done(egc, dss, rc);
+    domain_save_done(egc, dss, rc);
 }
 
 static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc)
 {
-    domain_suspend_done(egc, sws->dss, rc);
+    domain_save_done(egc, sws->dss, rc);
 }
 
 static void save_device_model_datacopier_done(libxl__egc *egc,
@@ -2232,8 +2232,8 @@ static void remus_teardown_done(libxl__egc *egc,
                                        libxl__remus_devices_state *rds,
                                        int rc);
 
-static void domain_suspend_done(libxl__egc *egc,
-                        libxl__domain_suspend_state *dss, int rc)
+static void domain_save_done(libxl__egc *egc,
+                             libxl__domain_suspend_state *dss, int rc)
 {
     STATE_AO_GC(dss->ao);
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2b6b2a0..211118c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2959,6 +2959,13 @@ static inline bool libxl__conversion_helper_inuse
 
 
 /*----- Domain suspend (save) state structure -----*/
+/*
+ * "suspend" refers to quiescing the VM, so pausing qemu, making a
+ * remote_shutdown(SHUTDOWN_suspend) hypercall etc.
+ *
+ * "save" refers to the actions involved in actually shuffling the
+ * state of the VM, so xc_domain_save() etc.
+ */
 
 typedef struct libxl__domain_suspend_state libxl__domain_suspend_state;
 
@@ -3023,7 +3030,7 @@ typedef struct libxl__logdirty_switch {
 } libxl__logdirty_switch;
 
 struct libxl__domain_suspend_state {
-    /* set by caller of libxl__domain_suspend */
+    /* set by caller of libxl__domain_save */
     libxl__ao *ao;
     libxl__domain_suspend_cb *callback;
 
@@ -3388,8 +3395,8 @@ struct libxl__domain_create_state {
 /*----- Domain suspend (save) functions -----*/
 
 /* calls dss->callback when done */
-_hidden void libxl__domain_suspend(libxl__egc *egc,
-                                   libxl__domain_suspend_state *dss);
+_hidden void libxl__domain_save(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss);
 
 
 /* calls libxl__xc_domain_suspend_done when done */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIDz1-0000rn-CV; Thu, 23 Jul 2015 10:44: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 1ZIDyz-0000rf-Q6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	8C/A8-01068-975C0B55; Thu, 23 Jul 2015 10:44:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1437648244!26126807!1
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 26248 invoked from network); 23 Jul 2015 10:44:05 -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;
	23 Jul 2015 10:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDyu-0007vn-2X
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDyt-0006zj-NA
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:03 +0000
Date: Thu, 23 Jul 2015 10:44:03 +0000
Message-Id: <E1ZIDyt-0006zj-NA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: rename
	libxl__domain_suspend to libxl__domain_save
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73db059d35ed48d8ae5ba0d9d9323a15c3d47907
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Wed Jun 3 10:57:28 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:13 2015 +0100

    tools/libxl: rename libxl__domain_suspend to libxl__domain_save
    
    The suspend/save terminology used by libxc is more consistent.
    "suspend" refers to quiescing the VM, so pausing qemu, making a
    remote_shutdown(SHUTDOWN_suspend) hypercall etc.
    "save" refers to the actions involved in actually shuffling the
    state of the VM, so xc_domain_save() etc.
    
    libxl currently uses "suspend" to encapsulate both. The patch
    Rename libxl__domain_suspend() to libxl__domain_save() since it
    actually refers to shuffling the state of the VM.
    
    This results in some strangeness in that some functions called *save*
    are now passed a struct called *suspend*, this is temporary and is all
    fixed up later by the refactoring of the suspend_state.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Some comments, commit messages:
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c          |    4 ++--
 tools/libxl/libxl_dom.c      |   16 ++++++++--------
 tools/libxl/libxl_internal.h |   13 ++++++++++---
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3fe1b99..dbbce17 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -921,7 +921,7 @@ static void libxl__remus_setup_done(libxl__egc *egc,
     STATE_AO_GC(dss->ao);
 
     if (!rc) {
-        libxl__domain_suspend(egc, dss);
+        libxl__domain_save(egc, dss);
         return;
     }
 
@@ -988,7 +988,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
     dss->live = flags & LIBXL_SUSPEND_LIVE;
     dss->debug = flags & LIBXL_SUSPEND_DEBUG;
 
-    libxl__domain_suspend(egc, dss);
+    libxl__domain_save(egc, dss);
     return AO_INPROGRESS;
 
  out_err:
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 4cb247a..ddd94bf 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1155,8 +1155,8 @@ out:
 
 static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc);
-static void domain_suspend_done(libxl__egc *egc,
-                        libxl__domain_suspend_state *dss, int rc);
+static void domain_save_done(libxl__egc *egc,
+                             libxl__domain_suspend_state *dss, int rc);
 static void domain_suspend_callback_common_done(libxl__egc *egc,
                                 libxl__domain_suspend_state *dss, int rc);
 
@@ -2039,9 +2039,9 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
     libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
 }
 
-/*----- main code for suspending, in order of execution -----*/
+/*----- main code for saving, in order of execution -----*/
 
-void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss)
+void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
 {
     STATE_AO_GC(dss->ao);
     int port;
@@ -2128,13 +2128,13 @@ void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss)
     return;
 
  out:
-    domain_suspend_done(egc, dss, rc);
+    domain_save_done(egc, dss, rc);
 }
 
 static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc)
 {
-    domain_suspend_done(egc, sws->dss, rc);
+    domain_save_done(egc, sws->dss, rc);
 }
 
 static void save_device_model_datacopier_done(libxl__egc *egc,
@@ -2232,8 +2232,8 @@ static void remus_teardown_done(libxl__egc *egc,
                                        libxl__remus_devices_state *rds,
                                        int rc);
 
-static void domain_suspend_done(libxl__egc *egc,
-                        libxl__domain_suspend_state *dss, int rc)
+static void domain_save_done(libxl__egc *egc,
+                             libxl__domain_suspend_state *dss, int rc)
 {
     STATE_AO_GC(dss->ao);
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2b6b2a0..211118c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2959,6 +2959,13 @@ static inline bool libxl__conversion_helper_inuse
 
 
 /*----- Domain suspend (save) state structure -----*/
+/*
+ * "suspend" refers to quiescing the VM, so pausing qemu, making a
+ * remote_shutdown(SHUTDOWN_suspend) hypercall etc.
+ *
+ * "save" refers to the actions involved in actually shuffling the
+ * state of the VM, so xc_domain_save() etc.
+ */
 
 typedef struct libxl__domain_suspend_state libxl__domain_suspend_state;
 
@@ -3023,7 +3030,7 @@ typedef struct libxl__logdirty_switch {
 } libxl__logdirty_switch;
 
 struct libxl__domain_suspend_state {
-    /* set by caller of libxl__domain_suspend */
+    /* set by caller of libxl__domain_save */
     libxl__ao *ao;
     libxl__domain_suspend_cb *callback;
 
@@ -3388,8 +3395,8 @@ struct libxl__domain_create_state {
 /*----- Domain suspend (save) functions -----*/
 
 /* calls dss->callback when done */
-_hidden void libxl__domain_suspend(libxl__egc *egc,
-                                   libxl__domain_suspend_state *dss);
+_hidden void libxl__domain_save(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss);
 
 
 /* calls libxl__xc_domain_suspend_done when done */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIDz9-0000su-Ew; Thu, 23 Jul 2015 10: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 1ZIDz8-0000sl-G6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:18 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	B2/E4-17050-185C0B55; Thu, 23 Jul 2015 10:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1437648254!28564293!1
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 22356 invoked from network); 23 Jul 2015 10:44:15 -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;
	23 Jul 2015 10:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDz4-0007vs-BU
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDz4-00070U-6U
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:14 +0000
Date: Thu, 23 Jul 2015 10:44:14 +0000
Message-Id: <E1ZIDz4-00070U-6U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: move domain suspend code
	into libxl_dom_suspend.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 f1fe54e5bf3c056794803df0e692c17d923cb847
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 10:24:30 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:30 2015 +0100

    tools/libxl: move domain suspend code into libxl_dom_suspend.c
    
    Move domain suspend code into a separate file libxl_dom_suspend.c.
    Add an API libxl__domain_suspend() which wraps the static
    function domain_suspend_callback_common() for internal use.
    Export the existing API libxl__domain_suspend_callback() used by
    libxc to suspend the guest during migration.
    
    Note that the newly added file libxl_dom_suspend.c is used for
    suspend/resume code.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/Makefile            |    3 +-
 tools/libxl/libxl_dom.c         |  342 +-----------------------------------
 tools/libxl/libxl_dom_suspend.c |  380 +++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_internal.h    |    6 +
 4 files changed, 389 insertions(+), 342 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6e74025..9036076 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -102,7 +102,8 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_json.o libxl_aoutils.o libxl_numa.o libxl_vnuma.o \
 			libxl_stream_read.o libxl_stream_write.o \
 			libxl_save_callout.o _libxl_save_msgs_callout.o \
-			libxl_qmp.o libxl_event.o libxl_fork.o $(LIBXL_OBJS-y)
+			libxl_qmp.o libxl_event.o libxl_fork.o \
+			libxl_dom_suspend.o $(LIBXL_OBJS-y)
 LIBXL_OBJS += libxl_genid.o
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index ddd94bf..0670a8f 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1157,8 +1157,6 @@ static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc);
 static void domain_save_done(libxl__egc *egc,
                              libxl__domain_suspend_state *dss, int rc);
-static void domain_suspend_callback_common_done(libxl__egc *egc,
-                                libxl__domain_suspend_state *dss, int rc);
 
 /*----- complicated callback, called by xc_domain_save -----*/
 
@@ -1386,35 +1384,6 @@ static void switch_logdirty_done(libxl__egc *egc,
 
 /*----- callbacks, called by xc_domain_save -----*/
 
-int libxl__domain_suspend_device_model(libxl__gc *gc,
-                                       libxl__domain_suspend_state *dss)
-{
-    int ret = 0;
-    uint32_t const domid = dss->domid;
-    const char *const filename = dss->dm_savefile;
-
-    switch (libxl__device_model_version_running(gc, domid)) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        LOG(DEBUG, "Saving device model state to %s", filename);
-        libxl__qemu_traditional_cmd(gc, domid, "save");
-        libxl__wait_for_device_model_deprecated(gc, domid, "paused", NULL, NULL, NULL);
-        break;
-    }
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        if (libxl__qmp_stop(gc, domid))
-            return ERROR_FAIL;
-        /* Save DM state into filename */
-        ret = libxl__qmp_save(gc, domid, filename);
-        if (ret)
-            unlink(filename);
-        break;
-    default:
-        return ERROR_INVAL;
-    }
-
-    return ret;
-}
-
 int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
 {
 
@@ -1435,298 +1404,6 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
     return 0;
 }
 
-static void domain_suspend_common_wait_guest(libxl__egc *egc,
-                                             libxl__domain_suspend_state *dss);
-static void domain_suspend_common_guest_suspended(libxl__egc *egc,
-                                         libxl__domain_suspend_state *dss);
-
-static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
-      libxl__xswait_state *xswa, int rc, const char *state);
-static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
-        libxl__ev_evtchn *evev);
-static void suspend_common_wait_guest_watch(libxl__egc *egc,
-      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path);
-static void suspend_common_wait_guest_check(libxl__egc *egc,
-        libxl__domain_suspend_state *dss);
-static void suspend_common_wait_guest_timeout(libxl__egc *egc,
-      libxl__ev_time *ev, const struct timeval *requested_abs, int rc);
-
-static void domain_suspend_common_done(libxl__egc *egc,
-                                       libxl__domain_suspend_state *dss,
-                                       int rc);
-
-static bool domain_suspend_pvcontrol_acked(const char *state) {
-    /* any value other than "suspend", including ENOENT (i.e. !state), is OK */
-    if (!state) return 1;
-    return strcmp(state,"suspend");
-}
-
-/* calls dss->callback_common_done when done */
-static void domain_suspend_callback_common(libxl__egc *egc,
-                                           libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    uint64_t hvm_s_state = 0, hvm_pvdrv = 0;
-    int ret, rc;
-
-    /* Convenience aliases */
-    const uint32_t domid = dss->domid;
-
-    if (dss->hvm) {
-        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv);
-        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state);
-    }
-
-    if ((hvm_s_state == 0) && (dss->guest_evtchn.port >= 0)) {
-        LOG(DEBUG, "issuing %s suspend request via event channel",
-            dss->hvm ? "PVHVM" : "PV");
-        ret = xc_evtchn_notify(CTX->xce, dss->guest_evtchn.port);
-        if (ret < 0) {
-            LOG(ERROR, "xc_evtchn_notify failed ret=%d", ret);
-            rc = ERROR_FAIL;
-            goto err;
-        }
-
-        dss->guest_evtchn.callback = domain_suspend_common_wait_guest_evtchn;
-        rc = libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
-        if (rc) goto err;
-
-        rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
-                                         suspend_common_wait_guest_timeout,
-                                         60*1000);
-        if (rc) goto err;
-
-        return;
-    }
-
-    if (dss->hvm && (!hvm_pvdrv || hvm_s_state)) {
-        LOG(DEBUG, "Calling xc_domain_shutdown on HVM domain");
-        ret = xc_domain_shutdown(CTX->xch, domid, SHUTDOWN_suspend);
-        if (ret < 0) {
-            LOGE(ERROR, "xc_domain_shutdown failed");
-            rc = ERROR_FAIL;
-            goto err;
-        }
-        /* The guest does not (need to) respond to this sort of request. */
-        dss->guest_responded = 1;
-        domain_suspend_common_wait_guest(egc, dss);
-        return;
-    }
-
-    LOG(DEBUG, "issuing %s suspend request via XenBus control node",
-        dss->hvm ? "PVHVM" : "PV");
-
-    libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, "suspend");
-
-    dss->pvcontrol.path = libxl__domain_pvcontrol_xspath(gc, domid);
-    if (!dss->pvcontrol.path) { rc = ERROR_FAIL; goto err; }
-
-    dss->pvcontrol.ao = ao;
-    dss->pvcontrol.what = "guest acknowledgement of suspend request";
-    dss->pvcontrol.timeout_ms = 60 * 1000;
-    dss->pvcontrol.callback = domain_suspend_common_pvcontrol_suspending;
-    libxl__xswait_start(gc, &dss->pvcontrol);
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
-        libxl__ev_evtchn *evev)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(evev, *dss, guest_evtchn);
-    STATE_AO_GC(dss->ao);
-    /* If we should be done waiting, suspend_common_wait_guest_check
-     * will end up calling domain_suspend_common_guest_suspended or
-     * domain_suspend_common_done, both of which cancel the evtchn
-     * wait as needed.  So re-enable it now. */
-    libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
-    suspend_common_wait_guest_check(egc, dss);
-}
-
-static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
-      libxl__xswait_state *xswa, int rc, const char *state)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(xswa, *dss, pvcontrol);
-    STATE_AO_GC(dss->ao);
-    xs_transaction_t t = 0;
-
-    if (!rc && !domain_suspend_pvcontrol_acked(state))
-        /* keep waiting */
-        return;
-
-    libxl__xswait_stop(gc, &dss->pvcontrol);
-
-    if (rc == ERROR_TIMEDOUT) {
-        /*
-         * Guest appears to not be responding. Cancel the suspend
-         * request.
-         *
-         * We re-read the suspend node and clear it within a
-         * transaction in order to handle the case where we race
-         * against the guest catching up and acknowledging the request
-         * at the last minute.
-         */
-        for (;;) {
-            rc = libxl__xs_transaction_start(gc, &t);
-            if (rc) goto err;
-
-            rc = libxl__xs_read_checked(gc, t, xswa->path, &state);
-            if (rc) goto err;
-
-            if (domain_suspend_pvcontrol_acked(state))
-                /* last minute ack */
-                break;
-
-            rc = libxl__xs_write_checked(gc, t, xswa->path, "");
-            if (rc) goto err;
-
-            rc = libxl__xs_transaction_commit(gc, &t);
-            if (!rc) {
-                LOG(ERROR,
-                    "guest didn't acknowledge suspend, cancelling request");
-                goto err;
-            }
-            if (rc<0) goto err;
-        }
-    } else if (rc) {
-        /* some error in xswait's read of xenstore, already logged */
-        goto err;
-    }
-
-    assert(domain_suspend_pvcontrol_acked(state));
-    LOG(DEBUG, "guest acknowledged suspend request");
-
-    libxl__xs_transaction_abort(gc, &t);
-    dss->guest_responded = 1;
-    domain_suspend_common_wait_guest(egc,dss);
-    return;
-
- err:
-    libxl__xs_transaction_abort(gc, &t);
-    domain_suspend_common_done(egc, dss, rc);
-    return;
-}
-
-static void domain_suspend_common_wait_guest(libxl__egc *egc,
-                                             libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    int rc;
-
-    LOG(DEBUG, "wait for the guest to suspend");
-
-    rc = libxl__ev_xswatch_register(gc, &dss->guest_watch,
-                                    suspend_common_wait_guest_watch,
-                                    "@releaseDomain");
-    if (rc) goto err;
-
-    rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
-                                     suspend_common_wait_guest_timeout,
-                                     60*1000);
-    if (rc) goto err;
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void suspend_common_wait_guest_watch(libxl__egc *egc,
-      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(xsw, *dss, guest_watch);
-    suspend_common_wait_guest_check(egc, dss);
-}
-
-static void suspend_common_wait_guest_check(libxl__egc *egc,
-        libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    xc_domaininfo_t info;
-    int ret;
-    int shutdown_reason;
-
-    /* Convenience aliases */
-    const uint32_t domid = dss->domid;
-
-    ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
-    if (ret < 0) {
-        LOGE(ERROR, "unable to check for status of guest %"PRId32"", domid);
-        goto err;
-    }
-
-    if (!(ret == 1 && info.domain == domid)) {
-        LOGE(ERROR, "guest %"PRId32" we were suspending has been destroyed",
-             domid);
-        goto err;
-    }
-
-    if (!(info.flags & XEN_DOMINF_shutdown))
-        /* keep waiting */
-        return;
-
-    shutdown_reason = (info.flags >> XEN_DOMINF_shutdownshift)
-        & XEN_DOMINF_shutdownmask;
-    if (shutdown_reason != SHUTDOWN_suspend) {
-        LOG(DEBUG, "guest %"PRId32" we were suspending has shut down"
-            " with unexpected reason code %d", domid, shutdown_reason);
-        goto err;
-    }
-
-    LOG(DEBUG, "guest has suspended");
-    domain_suspend_common_guest_suspended(egc, dss);
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, ERROR_FAIL);
-}
-
-static void suspend_common_wait_guest_timeout(libxl__egc *egc,
-      libxl__ev_time *ev, const struct timeval *requested_abs, int rc)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(ev, *dss, guest_timeout);
-    STATE_AO_GC(dss->ao);
-    if (rc == ERROR_TIMEDOUT) {
-        LOG(ERROR, "guest did not suspend, timed out");
-        rc = ERROR_GUEST_TIMEDOUT;
-    }
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void domain_suspend_common_guest_suspended(libxl__egc *egc,
-                                         libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    int rc;
-
-    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
-    libxl__ev_time_deregister(gc, &dss->guest_timeout);
-
-    if (dss->hvm) {
-        rc = libxl__domain_suspend_device_model(gc, dss);
-        if (rc) {
-            LOG(ERROR, "libxl__domain_suspend_device_model failed ret=%d", rc);
-            domain_suspend_common_done(egc, dss, rc);
-            return;
-        }
-    }
-    domain_suspend_common_done(egc, dss, 0);
-}
-
-static void domain_suspend_common_done(libxl__egc *egc,
-                                       libxl__domain_suspend_state *dss,
-                                       int rc)
-{
-    EGC_GC;
-    assert(!libxl__xswait_inuse(&dss->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
-    libxl__ev_time_deregister(gc, &dss->guest_timeout);
-    dss->callback_common_done(egc, dss, rc);
-}
-
 static inline char *physmap_path(libxl__gc *gc, uint32_t dm_domid,
                                  uint32_t domid,
                                  char *phys_offset, char *node)
@@ -1830,23 +1507,6 @@ out:
     return ret;
 }
 
-static void libxl__domain_suspend_callback(void *data)
-{
-    libxl__save_helper_state *shs = data;
-    libxl__egc *egc = shs->egc;
-    libxl__domain_suspend_state *dss = shs->caller_state;
-
-    dss->callback_common_done = domain_suspend_callback_common_done;
-    domain_suspend_callback_common(egc, dss);
-}
-
-static void domain_suspend_callback_common_done(libxl__egc *egc,
-                                libxl__domain_suspend_state *dss, int rc)
-{
-    dss->rc = rc;
-    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
-}
-
 /*----- remus callbacks -----*/
 static void remus_domain_suspend_callback_common_done(libxl__egc *egc,
                                 libxl__domain_suspend_state *dss, int ok);
@@ -1864,7 +1524,7 @@ static void libxl__remus_domain_suspend_callback(void *data)
     libxl__domain_suspend_state *dss = shs->caller_state;
 
     dss->callback_common_done = remus_domain_suspend_callback_common_done;
-    domain_suspend_callback_common(egc, dss);
+    libxl__domain_suspend(egc, dss);
 }
 
 static void remus_domain_suspend_callback_common_done(libxl__egc *egc,
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
new file mode 100644
index 0000000..5146402
--- /dev/null
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+
+#include "libxl_internal.h"
+
+/*====================== Domain suspend =======================*/
+
+/*----- callbacks, called by xc_domain_save -----*/
+
+int libxl__domain_suspend_device_model(libxl__gc *gc,
+                                       libxl__domain_suspend_state *dss)
+{
+    int ret = 0;
+    uint32_t const domid = dss->domid;
+    const char *const filename = dss->dm_savefile;
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
+        LOG(DEBUG, "Saving device model state to %s", filename);
+        libxl__qemu_traditional_cmd(gc, domid, "save");
+        libxl__wait_for_device_model_deprecated(gc, domid, "paused", NULL, NULL, NULL);
+        break;
+    }
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        if (libxl__qmp_stop(gc, domid))
+            return ERROR_FAIL;
+        /* Save DM state into filename */
+        ret = libxl__qmp_save(gc, domid, filename);
+        if (ret)
+            unlink(filename);
+        break;
+    default:
+        return ERROR_INVAL;
+    }
+
+    return ret;
+}
+
+static void domain_suspend_common_wait_guest(libxl__egc *egc,
+                                             libxl__domain_suspend_state *dss);
+static void domain_suspend_common_guest_suspended(libxl__egc *egc,
+                                         libxl__domain_suspend_state *dss);
+
+static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
+      libxl__xswait_state *xswa, int rc, const char *state);
+static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
+        libxl__ev_evtchn *evev);
+static void suspend_common_wait_guest_watch(libxl__egc *egc,
+      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path);
+static void suspend_common_wait_guest_check(libxl__egc *egc,
+        libxl__domain_suspend_state *dss);
+static void suspend_common_wait_guest_timeout(libxl__egc *egc,
+      libxl__ev_time *ev, const struct timeval *requested_abs, int rc);
+
+static void domain_suspend_common_done(libxl__egc *egc,
+                                       libxl__domain_suspend_state *dss,
+                                       int rc);
+
+static void domain_suspend_callback_common(libxl__egc *egc,
+                                           libxl__domain_suspend_state *dss);
+static void domain_suspend_callback_common_done(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss, int rc);
+
+/* calls dss->callback_common_done when done */
+void libxl__domain_suspend(libxl__egc *egc,
+                           libxl__domain_suspend_state *dss)
+{
+    domain_suspend_callback_common(egc, dss);
+}
+
+static bool domain_suspend_pvcontrol_acked(const char *state) {
+    /* any value other than "suspend", including ENOENT (i.e. !state), is OK */
+    if (!state) return 1;
+    return strcmp(state,"suspend");
+}
+
+/* calls dss->callback_common_done when done */
+static void domain_suspend_callback_common(libxl__egc *egc,
+                                           libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    uint64_t hvm_s_state = 0, hvm_pvdrv = 0;
+    int ret, rc;
+
+    /* Convenience aliases */
+    const uint32_t domid = dss->domid;
+
+    if (dss->hvm) {
+        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv);
+        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state);
+    }
+
+    if ((hvm_s_state == 0) && (dss->guest_evtchn.port >= 0)) {
+        LOG(DEBUG, "issuing %s suspend request via event channel",
+            dss->hvm ? "PVHVM" : "PV");
+        ret = xc_evtchn_notify(CTX->xce, dss->guest_evtchn.port);
+        if (ret < 0) {
+            LOG(ERROR, "xc_evtchn_notify failed ret=%d", ret);
+            rc = ERROR_FAIL;
+            goto err;
+        }
+
+        dss->guest_evtchn.callback = domain_suspend_common_wait_guest_evtchn;
+        rc = libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
+        if (rc) goto err;
+
+        rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
+                                         suspend_common_wait_guest_timeout,
+                                         60*1000);
+        if (rc) goto err;
+
+        return;
+    }
+
+    if (dss->hvm && (!hvm_pvdrv || hvm_s_state)) {
+        LOG(DEBUG, "Calling xc_domain_shutdown on HVM domain");
+        ret = xc_domain_shutdown(CTX->xch, domid, SHUTDOWN_suspend);
+        if (ret < 0) {
+            LOGE(ERROR, "xc_domain_shutdown failed");
+            rc = ERROR_FAIL;
+            goto err;
+        }
+        /* The guest does not (need to) respond to this sort of request. */
+        dss->guest_responded = 1;
+        domain_suspend_common_wait_guest(egc, dss);
+        return;
+    }
+
+    LOG(DEBUG, "issuing %s suspend request via XenBus control node",
+        dss->hvm ? "PVHVM" : "PV");
+
+    libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, "suspend");
+
+    dss->pvcontrol.path = libxl__domain_pvcontrol_xspath(gc, domid);
+    if (!dss->pvcontrol.path) { rc = ERROR_FAIL; goto err; }
+
+    dss->pvcontrol.ao = ao;
+    dss->pvcontrol.what = "guest acknowledgement of suspend request";
+    dss->pvcontrol.timeout_ms = 60 * 1000;
+    dss->pvcontrol.callback = domain_suspend_common_pvcontrol_suspending;
+    libxl__xswait_start(gc, &dss->pvcontrol);
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
+        libxl__ev_evtchn *evev)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(evev, *dss, guest_evtchn);
+    STATE_AO_GC(dss->ao);
+    /* If we should be done waiting, suspend_common_wait_guest_check
+     * will end up calling domain_suspend_common_guest_suspended or
+     * domain_suspend_common_done, both of which cancel the evtchn
+     * wait as needed.  So re-enable it now. */
+    libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
+    suspend_common_wait_guest_check(egc, dss);
+}
+
+static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
+      libxl__xswait_state *xswa, int rc, const char *state)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(xswa, *dss, pvcontrol);
+    STATE_AO_GC(dss->ao);
+    xs_transaction_t t = 0;
+
+    if (!rc && !domain_suspend_pvcontrol_acked(state))
+        /* keep waiting */
+        return;
+
+    libxl__xswait_stop(gc, &dss->pvcontrol);
+
+    if (rc == ERROR_TIMEDOUT) {
+        /*
+         * Guest appears to not be responding. Cancel the suspend
+         * request.
+         *
+         * We re-read the suspend node and clear it within a
+         * transaction in order to handle the case where we race
+         * against the guest catching up and acknowledging the request
+         * at the last minute.
+         */
+        for (;;) {
+            rc = libxl__xs_transaction_start(gc, &t);
+            if (rc) goto err;
+
+            rc = libxl__xs_read_checked(gc, t, xswa->path, &state);
+            if (rc) goto err;
+
+            if (domain_suspend_pvcontrol_acked(state))
+                /* last minute ack */
+                break;
+
+            rc = libxl__xs_write_checked(gc, t, xswa->path, "");
+            if (rc) goto err;
+
+            rc = libxl__xs_transaction_commit(gc, &t);
+            if (!rc) {
+                LOG(ERROR,
+                    "guest didn't acknowledge suspend, cancelling request");
+                goto err;
+            }
+            if (rc<0) goto err;
+        }
+    } else if (rc) {
+        /* some error in xswait's read of xenstore, already logged */
+        goto err;
+    }
+
+    assert(domain_suspend_pvcontrol_acked(state));
+    LOG(DEBUG, "guest acknowledged suspend request");
+
+    libxl__xs_transaction_abort(gc, &t);
+    dss->guest_responded = 1;
+    domain_suspend_common_wait_guest(egc,dss);
+    return;
+
+ err:
+    libxl__xs_transaction_abort(gc, &t);
+    domain_suspend_common_done(egc, dss, rc);
+    return;
+}
+
+static void domain_suspend_common_wait_guest(libxl__egc *egc,
+                                             libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    LOG(DEBUG, "wait for the guest to suspend");
+
+    rc = libxl__ev_xswatch_register(gc, &dss->guest_watch,
+                                    suspend_common_wait_guest_watch,
+                                    "@releaseDomain");
+    if (rc) goto err;
+
+    rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
+                                     suspend_common_wait_guest_timeout,
+                                     60*1000);
+    if (rc) goto err;
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void suspend_common_wait_guest_watch(libxl__egc *egc,
+      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(xsw, *dss, guest_watch);
+    suspend_common_wait_guest_check(egc, dss);
+}
+
+static void suspend_common_wait_guest_check(libxl__egc *egc,
+        libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    xc_domaininfo_t info;
+    int ret;
+    int shutdown_reason;
+
+    /* Convenience aliases */
+    const uint32_t domid = dss->domid;
+
+    ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
+    if (ret < 0) {
+        LOGE(ERROR, "unable to check for status of guest %"PRId32"", domid);
+        goto err;
+    }
+
+    if (!(ret == 1 && info.domain == domid)) {
+        LOGE(ERROR, "guest %"PRId32" we were suspending has been destroyed",
+             domid);
+        goto err;
+    }
+
+    if (!(info.flags & XEN_DOMINF_shutdown))
+        /* keep waiting */
+        return;
+
+    shutdown_reason = (info.flags >> XEN_DOMINF_shutdownshift)
+        & XEN_DOMINF_shutdownmask;
+    if (shutdown_reason != SHUTDOWN_suspend) {
+        LOG(DEBUG, "guest %"PRId32" we were suspending has shut down"
+            " with unexpected reason code %d", domid, shutdown_reason);
+        goto err;
+    }
+
+    LOG(DEBUG, "guest has suspended");
+    domain_suspend_common_guest_suspended(egc, dss);
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, ERROR_FAIL);
+}
+
+static void suspend_common_wait_guest_timeout(libxl__egc *egc,
+      libxl__ev_time *ev, const struct timeval *requested_abs, int rc)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(ev, *dss, guest_timeout);
+    STATE_AO_GC(dss->ao);
+    if (rc == ERROR_TIMEDOUT) {
+        LOG(ERROR, "guest did not suspend, timed out");
+        rc = ERROR_GUEST_TIMEDOUT;
+    }
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void domain_suspend_common_guest_suspended(libxl__egc *egc,
+                                         libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
+    libxl__ev_time_deregister(gc, &dss->guest_timeout);
+
+    if (dss->hvm) {
+        rc = libxl__domain_suspend_device_model(gc, dss);
+        if (rc) {
+            LOG(ERROR, "libxl__domain_suspend_device_model failed ret=%d", rc);
+            domain_suspend_common_done(egc, dss, rc);
+            return;
+        }
+    }
+    domain_suspend_common_done(egc, dss, 0);
+}
+
+static void domain_suspend_common_done(libxl__egc *egc,
+                                       libxl__domain_suspend_state *dss,
+                                       int rc)
+{
+    EGC_GC;
+    assert(!libxl__xswait_inuse(&dss->pvcontrol));
+    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
+    libxl__ev_time_deregister(gc, &dss->guest_timeout);
+    dss->callback_common_done(egc, dss, rc);
+}
+
+void libxl__domain_suspend_callback(void *data)
+{
+    libxl__save_helper_state *shs = data;
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = shs->caller_state;
+
+    dss->callback_common_done = domain_suspend_callback_common_done;
+    domain_suspend_callback_common(egc, dss);
+}
+
+static void domain_suspend_callback_common_done(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss, int rc)
+{
+    dss->rc = rc;
+    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 211118c..3ee9fcc 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3452,6 +3452,12 @@ _hidden void libxl__domain_save_device_model(libxl__egc *egc,
 
 _hidden const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid);
 
+/* calls dss->callback_common_done when done */
+_hidden void libxl__domain_suspend(libxl__egc *egc,
+                                   libxl__domain_suspend_state *dss);
+/* used by libxc to suspend the guest during migration */
+_hidden void libxl__domain_suspend_callback(void *data);
+
 
 /*
  * Convenience macros.
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIDz9-0000su-Ew; Thu, 23 Jul 2015 10: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 1ZIDz8-0000sl-G6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:18 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	B2/E4-17050-185C0B55; Thu, 23 Jul 2015 10:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1437648254!28564293!1
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 22356 invoked from network); 23 Jul 2015 10:44:15 -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;
	23 Jul 2015 10:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDz4-0007vs-BU
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDz4-00070U-6U
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:14 +0000
Date: Thu, 23 Jul 2015 10:44:14 +0000
Message-Id: <E1ZIDz4-00070U-6U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: move domain suspend code
	into libxl_dom_suspend.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 f1fe54e5bf3c056794803df0e692c17d923cb847
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 10:24:30 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:30 2015 +0100

    tools/libxl: move domain suspend code into libxl_dom_suspend.c
    
    Move domain suspend code into a separate file libxl_dom_suspend.c.
    Add an API libxl__domain_suspend() which wraps the static
    function domain_suspend_callback_common() for internal use.
    Export the existing API libxl__domain_suspend_callback() used by
    libxc to suspend the guest during migration.
    
    Note that the newly added file libxl_dom_suspend.c is used for
    suspend/resume code.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/Makefile            |    3 +-
 tools/libxl/libxl_dom.c         |  342 +-----------------------------------
 tools/libxl/libxl_dom_suspend.c |  380 +++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_internal.h    |    6 +
 4 files changed, 389 insertions(+), 342 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6e74025..9036076 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -102,7 +102,8 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_json.o libxl_aoutils.o libxl_numa.o libxl_vnuma.o \
 			libxl_stream_read.o libxl_stream_write.o \
 			libxl_save_callout.o _libxl_save_msgs_callout.o \
-			libxl_qmp.o libxl_event.o libxl_fork.o $(LIBXL_OBJS-y)
+			libxl_qmp.o libxl_event.o libxl_fork.o \
+			libxl_dom_suspend.o $(LIBXL_OBJS-y)
 LIBXL_OBJS += libxl_genid.o
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index ddd94bf..0670a8f 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1157,8 +1157,6 @@ static void stream_done(libxl__egc *egc,
                         libxl__stream_write_state *sws, int rc);
 static void domain_save_done(libxl__egc *egc,
                              libxl__domain_suspend_state *dss, int rc);
-static void domain_suspend_callback_common_done(libxl__egc *egc,
-                                libxl__domain_suspend_state *dss, int rc);
 
 /*----- complicated callback, called by xc_domain_save -----*/
 
@@ -1386,35 +1384,6 @@ static void switch_logdirty_done(libxl__egc *egc,
 
 /*----- callbacks, called by xc_domain_save -----*/
 
-int libxl__domain_suspend_device_model(libxl__gc *gc,
-                                       libxl__domain_suspend_state *dss)
-{
-    int ret = 0;
-    uint32_t const domid = dss->domid;
-    const char *const filename = dss->dm_savefile;
-
-    switch (libxl__device_model_version_running(gc, domid)) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        LOG(DEBUG, "Saving device model state to %s", filename);
-        libxl__qemu_traditional_cmd(gc, domid, "save");
-        libxl__wait_for_device_model_deprecated(gc, domid, "paused", NULL, NULL, NULL);
-        break;
-    }
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        if (libxl__qmp_stop(gc, domid))
-            return ERROR_FAIL;
-        /* Save DM state into filename */
-        ret = libxl__qmp_save(gc, domid, filename);
-        if (ret)
-            unlink(filename);
-        break;
-    default:
-        return ERROR_INVAL;
-    }
-
-    return ret;
-}
-
 int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
 {
 
@@ -1435,298 +1404,6 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
     return 0;
 }
 
-static void domain_suspend_common_wait_guest(libxl__egc *egc,
-                                             libxl__domain_suspend_state *dss);
-static void domain_suspend_common_guest_suspended(libxl__egc *egc,
-                                         libxl__domain_suspend_state *dss);
-
-static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
-      libxl__xswait_state *xswa, int rc, const char *state);
-static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
-        libxl__ev_evtchn *evev);
-static void suspend_common_wait_guest_watch(libxl__egc *egc,
-      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path);
-static void suspend_common_wait_guest_check(libxl__egc *egc,
-        libxl__domain_suspend_state *dss);
-static void suspend_common_wait_guest_timeout(libxl__egc *egc,
-      libxl__ev_time *ev, const struct timeval *requested_abs, int rc);
-
-static void domain_suspend_common_done(libxl__egc *egc,
-                                       libxl__domain_suspend_state *dss,
-                                       int rc);
-
-static bool domain_suspend_pvcontrol_acked(const char *state) {
-    /* any value other than "suspend", including ENOENT (i.e. !state), is OK */
-    if (!state) return 1;
-    return strcmp(state,"suspend");
-}
-
-/* calls dss->callback_common_done when done */
-static void domain_suspend_callback_common(libxl__egc *egc,
-                                           libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    uint64_t hvm_s_state = 0, hvm_pvdrv = 0;
-    int ret, rc;
-
-    /* Convenience aliases */
-    const uint32_t domid = dss->domid;
-
-    if (dss->hvm) {
-        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv);
-        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state);
-    }
-
-    if ((hvm_s_state == 0) && (dss->guest_evtchn.port >= 0)) {
-        LOG(DEBUG, "issuing %s suspend request via event channel",
-            dss->hvm ? "PVHVM" : "PV");
-        ret = xc_evtchn_notify(CTX->xce, dss->guest_evtchn.port);
-        if (ret < 0) {
-            LOG(ERROR, "xc_evtchn_notify failed ret=%d", ret);
-            rc = ERROR_FAIL;
-            goto err;
-        }
-
-        dss->guest_evtchn.callback = domain_suspend_common_wait_guest_evtchn;
-        rc = libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
-        if (rc) goto err;
-
-        rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
-                                         suspend_common_wait_guest_timeout,
-                                         60*1000);
-        if (rc) goto err;
-
-        return;
-    }
-
-    if (dss->hvm && (!hvm_pvdrv || hvm_s_state)) {
-        LOG(DEBUG, "Calling xc_domain_shutdown on HVM domain");
-        ret = xc_domain_shutdown(CTX->xch, domid, SHUTDOWN_suspend);
-        if (ret < 0) {
-            LOGE(ERROR, "xc_domain_shutdown failed");
-            rc = ERROR_FAIL;
-            goto err;
-        }
-        /* The guest does not (need to) respond to this sort of request. */
-        dss->guest_responded = 1;
-        domain_suspend_common_wait_guest(egc, dss);
-        return;
-    }
-
-    LOG(DEBUG, "issuing %s suspend request via XenBus control node",
-        dss->hvm ? "PVHVM" : "PV");
-
-    libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, "suspend");
-
-    dss->pvcontrol.path = libxl__domain_pvcontrol_xspath(gc, domid);
-    if (!dss->pvcontrol.path) { rc = ERROR_FAIL; goto err; }
-
-    dss->pvcontrol.ao = ao;
-    dss->pvcontrol.what = "guest acknowledgement of suspend request";
-    dss->pvcontrol.timeout_ms = 60 * 1000;
-    dss->pvcontrol.callback = domain_suspend_common_pvcontrol_suspending;
-    libxl__xswait_start(gc, &dss->pvcontrol);
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
-        libxl__ev_evtchn *evev)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(evev, *dss, guest_evtchn);
-    STATE_AO_GC(dss->ao);
-    /* If we should be done waiting, suspend_common_wait_guest_check
-     * will end up calling domain_suspend_common_guest_suspended or
-     * domain_suspend_common_done, both of which cancel the evtchn
-     * wait as needed.  So re-enable it now. */
-    libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
-    suspend_common_wait_guest_check(egc, dss);
-}
-
-static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
-      libxl__xswait_state *xswa, int rc, const char *state)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(xswa, *dss, pvcontrol);
-    STATE_AO_GC(dss->ao);
-    xs_transaction_t t = 0;
-
-    if (!rc && !domain_suspend_pvcontrol_acked(state))
-        /* keep waiting */
-        return;
-
-    libxl__xswait_stop(gc, &dss->pvcontrol);
-
-    if (rc == ERROR_TIMEDOUT) {
-        /*
-         * Guest appears to not be responding. Cancel the suspend
-         * request.
-         *
-         * We re-read the suspend node and clear it within a
-         * transaction in order to handle the case where we race
-         * against the guest catching up and acknowledging the request
-         * at the last minute.
-         */
-        for (;;) {
-            rc = libxl__xs_transaction_start(gc, &t);
-            if (rc) goto err;
-
-            rc = libxl__xs_read_checked(gc, t, xswa->path, &state);
-            if (rc) goto err;
-
-            if (domain_suspend_pvcontrol_acked(state))
-                /* last minute ack */
-                break;
-
-            rc = libxl__xs_write_checked(gc, t, xswa->path, "");
-            if (rc) goto err;
-
-            rc = libxl__xs_transaction_commit(gc, &t);
-            if (!rc) {
-                LOG(ERROR,
-                    "guest didn't acknowledge suspend, cancelling request");
-                goto err;
-            }
-            if (rc<0) goto err;
-        }
-    } else if (rc) {
-        /* some error in xswait's read of xenstore, already logged */
-        goto err;
-    }
-
-    assert(domain_suspend_pvcontrol_acked(state));
-    LOG(DEBUG, "guest acknowledged suspend request");
-
-    libxl__xs_transaction_abort(gc, &t);
-    dss->guest_responded = 1;
-    domain_suspend_common_wait_guest(egc,dss);
-    return;
-
- err:
-    libxl__xs_transaction_abort(gc, &t);
-    domain_suspend_common_done(egc, dss, rc);
-    return;
-}
-
-static void domain_suspend_common_wait_guest(libxl__egc *egc,
-                                             libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    int rc;
-
-    LOG(DEBUG, "wait for the guest to suspend");
-
-    rc = libxl__ev_xswatch_register(gc, &dss->guest_watch,
-                                    suspend_common_wait_guest_watch,
-                                    "@releaseDomain");
-    if (rc) goto err;
-
-    rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
-                                     suspend_common_wait_guest_timeout,
-                                     60*1000);
-    if (rc) goto err;
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void suspend_common_wait_guest_watch(libxl__egc *egc,
-      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(xsw, *dss, guest_watch);
-    suspend_common_wait_guest_check(egc, dss);
-}
-
-static void suspend_common_wait_guest_check(libxl__egc *egc,
-        libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    xc_domaininfo_t info;
-    int ret;
-    int shutdown_reason;
-
-    /* Convenience aliases */
-    const uint32_t domid = dss->domid;
-
-    ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
-    if (ret < 0) {
-        LOGE(ERROR, "unable to check for status of guest %"PRId32"", domid);
-        goto err;
-    }
-
-    if (!(ret == 1 && info.domain == domid)) {
-        LOGE(ERROR, "guest %"PRId32" we were suspending has been destroyed",
-             domid);
-        goto err;
-    }
-
-    if (!(info.flags & XEN_DOMINF_shutdown))
-        /* keep waiting */
-        return;
-
-    shutdown_reason = (info.flags >> XEN_DOMINF_shutdownshift)
-        & XEN_DOMINF_shutdownmask;
-    if (shutdown_reason != SHUTDOWN_suspend) {
-        LOG(DEBUG, "guest %"PRId32" we were suspending has shut down"
-            " with unexpected reason code %d", domid, shutdown_reason);
-        goto err;
-    }
-
-    LOG(DEBUG, "guest has suspended");
-    domain_suspend_common_guest_suspended(egc, dss);
-    return;
-
- err:
-    domain_suspend_common_done(egc, dss, ERROR_FAIL);
-}
-
-static void suspend_common_wait_guest_timeout(libxl__egc *egc,
-      libxl__ev_time *ev, const struct timeval *requested_abs, int rc)
-{
-    libxl__domain_suspend_state *dss = CONTAINER_OF(ev, *dss, guest_timeout);
-    STATE_AO_GC(dss->ao);
-    if (rc == ERROR_TIMEDOUT) {
-        LOG(ERROR, "guest did not suspend, timed out");
-        rc = ERROR_GUEST_TIMEDOUT;
-    }
-    domain_suspend_common_done(egc, dss, rc);
-}
-
-static void domain_suspend_common_guest_suspended(libxl__egc *egc,
-                                         libxl__domain_suspend_state *dss)
-{
-    STATE_AO_GC(dss->ao);
-    int rc;
-
-    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
-    libxl__ev_time_deregister(gc, &dss->guest_timeout);
-
-    if (dss->hvm) {
-        rc = libxl__domain_suspend_device_model(gc, dss);
-        if (rc) {
-            LOG(ERROR, "libxl__domain_suspend_device_model failed ret=%d", rc);
-            domain_suspend_common_done(egc, dss, rc);
-            return;
-        }
-    }
-    domain_suspend_common_done(egc, dss, 0);
-}
-
-static void domain_suspend_common_done(libxl__egc *egc,
-                                       libxl__domain_suspend_state *dss,
-                                       int rc)
-{
-    EGC_GC;
-    assert(!libxl__xswait_inuse(&dss->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
-    libxl__ev_time_deregister(gc, &dss->guest_timeout);
-    dss->callback_common_done(egc, dss, rc);
-}
-
 static inline char *physmap_path(libxl__gc *gc, uint32_t dm_domid,
                                  uint32_t domid,
                                  char *phys_offset, char *node)
@@ -1830,23 +1507,6 @@ out:
     return ret;
 }
 
-static void libxl__domain_suspend_callback(void *data)
-{
-    libxl__save_helper_state *shs = data;
-    libxl__egc *egc = shs->egc;
-    libxl__domain_suspend_state *dss = shs->caller_state;
-
-    dss->callback_common_done = domain_suspend_callback_common_done;
-    domain_suspend_callback_common(egc, dss);
-}
-
-static void domain_suspend_callback_common_done(libxl__egc *egc,
-                                libxl__domain_suspend_state *dss, int rc)
-{
-    dss->rc = rc;
-    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
-}
-
 /*----- remus callbacks -----*/
 static void remus_domain_suspend_callback_common_done(libxl__egc *egc,
                                 libxl__domain_suspend_state *dss, int ok);
@@ -1864,7 +1524,7 @@ static void libxl__remus_domain_suspend_callback(void *data)
     libxl__domain_suspend_state *dss = shs->caller_state;
 
     dss->callback_common_done = remus_domain_suspend_callback_common_done;
-    domain_suspend_callback_common(egc, dss);
+    libxl__domain_suspend(egc, dss);
 }
 
 static void remus_domain_suspend_callback_common_done(libxl__egc *egc,
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
new file mode 100644
index 0000000..5146402
--- /dev/null
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+
+#include "libxl_internal.h"
+
+/*====================== Domain suspend =======================*/
+
+/*----- callbacks, called by xc_domain_save -----*/
+
+int libxl__domain_suspend_device_model(libxl__gc *gc,
+                                       libxl__domain_suspend_state *dss)
+{
+    int ret = 0;
+    uint32_t const domid = dss->domid;
+    const char *const filename = dss->dm_savefile;
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
+        LOG(DEBUG, "Saving device model state to %s", filename);
+        libxl__qemu_traditional_cmd(gc, domid, "save");
+        libxl__wait_for_device_model_deprecated(gc, domid, "paused", NULL, NULL, NULL);
+        break;
+    }
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        if (libxl__qmp_stop(gc, domid))
+            return ERROR_FAIL;
+        /* Save DM state into filename */
+        ret = libxl__qmp_save(gc, domid, filename);
+        if (ret)
+            unlink(filename);
+        break;
+    default:
+        return ERROR_INVAL;
+    }
+
+    return ret;
+}
+
+static void domain_suspend_common_wait_guest(libxl__egc *egc,
+                                             libxl__domain_suspend_state *dss);
+static void domain_suspend_common_guest_suspended(libxl__egc *egc,
+                                         libxl__domain_suspend_state *dss);
+
+static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
+      libxl__xswait_state *xswa, int rc, const char *state);
+static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
+        libxl__ev_evtchn *evev);
+static void suspend_common_wait_guest_watch(libxl__egc *egc,
+      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path);
+static void suspend_common_wait_guest_check(libxl__egc *egc,
+        libxl__domain_suspend_state *dss);
+static void suspend_common_wait_guest_timeout(libxl__egc *egc,
+      libxl__ev_time *ev, const struct timeval *requested_abs, int rc);
+
+static void domain_suspend_common_done(libxl__egc *egc,
+                                       libxl__domain_suspend_state *dss,
+                                       int rc);
+
+static void domain_suspend_callback_common(libxl__egc *egc,
+                                           libxl__domain_suspend_state *dss);
+static void domain_suspend_callback_common_done(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss, int rc);
+
+/* calls dss->callback_common_done when done */
+void libxl__domain_suspend(libxl__egc *egc,
+                           libxl__domain_suspend_state *dss)
+{
+    domain_suspend_callback_common(egc, dss);
+}
+
+static bool domain_suspend_pvcontrol_acked(const char *state) {
+    /* any value other than "suspend", including ENOENT (i.e. !state), is OK */
+    if (!state) return 1;
+    return strcmp(state,"suspend");
+}
+
+/* calls dss->callback_common_done when done */
+static void domain_suspend_callback_common(libxl__egc *egc,
+                                           libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    uint64_t hvm_s_state = 0, hvm_pvdrv = 0;
+    int ret, rc;
+
+    /* Convenience aliases */
+    const uint32_t domid = dss->domid;
+
+    if (dss->hvm) {
+        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv);
+        xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state);
+    }
+
+    if ((hvm_s_state == 0) && (dss->guest_evtchn.port >= 0)) {
+        LOG(DEBUG, "issuing %s suspend request via event channel",
+            dss->hvm ? "PVHVM" : "PV");
+        ret = xc_evtchn_notify(CTX->xce, dss->guest_evtchn.port);
+        if (ret < 0) {
+            LOG(ERROR, "xc_evtchn_notify failed ret=%d", ret);
+            rc = ERROR_FAIL;
+            goto err;
+        }
+
+        dss->guest_evtchn.callback = domain_suspend_common_wait_guest_evtchn;
+        rc = libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
+        if (rc) goto err;
+
+        rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
+                                         suspend_common_wait_guest_timeout,
+                                         60*1000);
+        if (rc) goto err;
+
+        return;
+    }
+
+    if (dss->hvm && (!hvm_pvdrv || hvm_s_state)) {
+        LOG(DEBUG, "Calling xc_domain_shutdown on HVM domain");
+        ret = xc_domain_shutdown(CTX->xch, domid, SHUTDOWN_suspend);
+        if (ret < 0) {
+            LOGE(ERROR, "xc_domain_shutdown failed");
+            rc = ERROR_FAIL;
+            goto err;
+        }
+        /* The guest does not (need to) respond to this sort of request. */
+        dss->guest_responded = 1;
+        domain_suspend_common_wait_guest(egc, dss);
+        return;
+    }
+
+    LOG(DEBUG, "issuing %s suspend request via XenBus control node",
+        dss->hvm ? "PVHVM" : "PV");
+
+    libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, "suspend");
+
+    dss->pvcontrol.path = libxl__domain_pvcontrol_xspath(gc, domid);
+    if (!dss->pvcontrol.path) { rc = ERROR_FAIL; goto err; }
+
+    dss->pvcontrol.ao = ao;
+    dss->pvcontrol.what = "guest acknowledgement of suspend request";
+    dss->pvcontrol.timeout_ms = 60 * 1000;
+    dss->pvcontrol.callback = domain_suspend_common_pvcontrol_suspending;
+    libxl__xswait_start(gc, &dss->pvcontrol);
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void domain_suspend_common_wait_guest_evtchn(libxl__egc *egc,
+        libxl__ev_evtchn *evev)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(evev, *dss, guest_evtchn);
+    STATE_AO_GC(dss->ao);
+    /* If we should be done waiting, suspend_common_wait_guest_check
+     * will end up calling domain_suspend_common_guest_suspended or
+     * domain_suspend_common_done, both of which cancel the evtchn
+     * wait as needed.  So re-enable it now. */
+    libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
+    suspend_common_wait_guest_check(egc, dss);
+}
+
+static void domain_suspend_common_pvcontrol_suspending(libxl__egc *egc,
+      libxl__xswait_state *xswa, int rc, const char *state)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(xswa, *dss, pvcontrol);
+    STATE_AO_GC(dss->ao);
+    xs_transaction_t t = 0;
+
+    if (!rc && !domain_suspend_pvcontrol_acked(state))
+        /* keep waiting */
+        return;
+
+    libxl__xswait_stop(gc, &dss->pvcontrol);
+
+    if (rc == ERROR_TIMEDOUT) {
+        /*
+         * Guest appears to not be responding. Cancel the suspend
+         * request.
+         *
+         * We re-read the suspend node and clear it within a
+         * transaction in order to handle the case where we race
+         * against the guest catching up and acknowledging the request
+         * at the last minute.
+         */
+        for (;;) {
+            rc = libxl__xs_transaction_start(gc, &t);
+            if (rc) goto err;
+
+            rc = libxl__xs_read_checked(gc, t, xswa->path, &state);
+            if (rc) goto err;
+
+            if (domain_suspend_pvcontrol_acked(state))
+                /* last minute ack */
+                break;
+
+            rc = libxl__xs_write_checked(gc, t, xswa->path, "");
+            if (rc) goto err;
+
+            rc = libxl__xs_transaction_commit(gc, &t);
+            if (!rc) {
+                LOG(ERROR,
+                    "guest didn't acknowledge suspend, cancelling request");
+                goto err;
+            }
+            if (rc<0) goto err;
+        }
+    } else if (rc) {
+        /* some error in xswait's read of xenstore, already logged */
+        goto err;
+    }
+
+    assert(domain_suspend_pvcontrol_acked(state));
+    LOG(DEBUG, "guest acknowledged suspend request");
+
+    libxl__xs_transaction_abort(gc, &t);
+    dss->guest_responded = 1;
+    domain_suspend_common_wait_guest(egc,dss);
+    return;
+
+ err:
+    libxl__xs_transaction_abort(gc, &t);
+    domain_suspend_common_done(egc, dss, rc);
+    return;
+}
+
+static void domain_suspend_common_wait_guest(libxl__egc *egc,
+                                             libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    LOG(DEBUG, "wait for the guest to suspend");
+
+    rc = libxl__ev_xswatch_register(gc, &dss->guest_watch,
+                                    suspend_common_wait_guest_watch,
+                                    "@releaseDomain");
+    if (rc) goto err;
+
+    rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
+                                     suspend_common_wait_guest_timeout,
+                                     60*1000);
+    if (rc) goto err;
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void suspend_common_wait_guest_watch(libxl__egc *egc,
+      libxl__ev_xswatch *xsw, const char *watch_path, const char *event_path)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(xsw, *dss, guest_watch);
+    suspend_common_wait_guest_check(egc, dss);
+}
+
+static void suspend_common_wait_guest_check(libxl__egc *egc,
+        libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    xc_domaininfo_t info;
+    int ret;
+    int shutdown_reason;
+
+    /* Convenience aliases */
+    const uint32_t domid = dss->domid;
+
+    ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
+    if (ret < 0) {
+        LOGE(ERROR, "unable to check for status of guest %"PRId32"", domid);
+        goto err;
+    }
+
+    if (!(ret == 1 && info.domain == domid)) {
+        LOGE(ERROR, "guest %"PRId32" we were suspending has been destroyed",
+             domid);
+        goto err;
+    }
+
+    if (!(info.flags & XEN_DOMINF_shutdown))
+        /* keep waiting */
+        return;
+
+    shutdown_reason = (info.flags >> XEN_DOMINF_shutdownshift)
+        & XEN_DOMINF_shutdownmask;
+    if (shutdown_reason != SHUTDOWN_suspend) {
+        LOG(DEBUG, "guest %"PRId32" we were suspending has shut down"
+            " with unexpected reason code %d", domid, shutdown_reason);
+        goto err;
+    }
+
+    LOG(DEBUG, "guest has suspended");
+    domain_suspend_common_guest_suspended(egc, dss);
+    return;
+
+ err:
+    domain_suspend_common_done(egc, dss, ERROR_FAIL);
+}
+
+static void suspend_common_wait_guest_timeout(libxl__egc *egc,
+      libxl__ev_time *ev, const struct timeval *requested_abs, int rc)
+{
+    libxl__domain_suspend_state *dss = CONTAINER_OF(ev, *dss, guest_timeout);
+    STATE_AO_GC(dss->ao);
+    if (rc == ERROR_TIMEDOUT) {
+        LOG(ERROR, "guest did not suspend, timed out");
+        rc = ERROR_GUEST_TIMEDOUT;
+    }
+    domain_suspend_common_done(egc, dss, rc);
+}
+
+static void domain_suspend_common_guest_suspended(libxl__egc *egc,
+                                         libxl__domain_suspend_state *dss)
+{
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
+    libxl__ev_time_deregister(gc, &dss->guest_timeout);
+
+    if (dss->hvm) {
+        rc = libxl__domain_suspend_device_model(gc, dss);
+        if (rc) {
+            LOG(ERROR, "libxl__domain_suspend_device_model failed ret=%d", rc);
+            domain_suspend_common_done(egc, dss, rc);
+            return;
+        }
+    }
+    domain_suspend_common_done(egc, dss, 0);
+}
+
+static void domain_suspend_common_done(libxl__egc *egc,
+                                       libxl__domain_suspend_state *dss,
+                                       int rc)
+{
+    EGC_GC;
+    assert(!libxl__xswait_inuse(&dss->pvcontrol));
+    libxl__ev_evtchn_cancel(gc, &dss->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dss->guest_watch);
+    libxl__ev_time_deregister(gc, &dss->guest_timeout);
+    dss->callback_common_done(egc, dss, rc);
+}
+
+void libxl__domain_suspend_callback(void *data)
+{
+    libxl__save_helper_state *shs = data;
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = shs->caller_state;
+
+    dss->callback_common_done = domain_suspend_callback_common_done;
+    domain_suspend_callback_common(egc, dss);
+}
+
+static void domain_suspend_callback_common_done(libxl__egc *egc,
+                                libxl__domain_suspend_state *dss, int rc)
+{
+    dss->rc = rc;
+    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 211118c..3ee9fcc 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3452,6 +3452,12 @@ _hidden void libxl__domain_save_device_model(libxl__egc *egc,
 
 _hidden const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid);
 
+/* calls dss->callback_common_done when done */
+_hidden void libxl__domain_suspend(libxl__egc *egc,
+                                   libxl__domain_suspend_state *dss);
+/* used by libxc to suspend the guest during migration */
+_hidden void libxl__domain_suspend_callback(void *data);
+
 
 /*
  * Convenience macros.
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzI-0000uV-KX; Thu, 23 Jul 2015 10:44:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzH-0000uJ-7Y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:27 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	29/6C-27764-A85C0B55; Thu, 23 Jul 2015 10:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1437648264!34591895!1
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 6445 invoked from network); 23 Jul 2015 10:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzE-0007w3-Iy
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzE-00071m-EW
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:24 +0000
Date: Thu, 23 Jul 2015 10:44:24 +0000
Message-Id: <E1ZIDzE-00071m-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: move domain resume code
	into libxl_dom_suspend.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 bc3e7ff7ecdad6070f14b51fa7f6957b3e24e8a8
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 12:11:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:38 2015 +0100

    tools/libxl: move domain resume code into libxl_dom_suspend.c
    
    move domain resume code into libxl_dom_suspend.c.
    pure code move.
    
    libxl__domain_resume_device_model() will be used later by COLO,
    so we are not making this func static.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c             |   33 -----------------------
 tools/libxl/libxl_dom.c         |   20 --------------
 tools/libxl/libxl_dom_suspend.c |   55 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index dbbce17..d8343a9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -520,39 +520,6 @@ int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
-int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
-{
-    int rc = 0;
-
-    if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {
-        LOGE(ERROR, "xc_domain_resume failed for domain %u", domid);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    libxl_domain_type type = libxl__domain_type(gc, domid);
-    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        rc = libxl__domain_resume_device_model(gc, domid);
-        if (rc) {
-            LOG(ERROR, "failed to resume device model for domain %u:%d",
-                domid, rc);
-            goto out;
-        }
-    }
-
-    if (!xs_resume_domain(CTX->xsh, domid)) {
-        LOGE(ERROR, "xs_resume_domain failed for domain %u", domid);
-        rc = ERROR_FAIL;
-    }
-out:
-    return rc;
-}
-
 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
 {
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0670a8f..5db518c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1384,26 +1384,6 @@ static void switch_logdirty_done(libxl__egc *egc,
 
 /*----- callbacks, called by xc_domain_save -----*/
 
-int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
-{
-
-    switch (libxl__device_model_version_running(gc, domid)) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        libxl__qemu_traditional_cmd(gc, domid, "continue");
-        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
-        break;
-    }
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        if (libxl__qmp_resume(gc, domid))
-            return ERROR_FAIL;
-        break;
-    default:
-        return ERROR_INVAL;
-    }
-
-    return 0;
-}
-
 static inline char *physmap_path(libxl__gc *gc, uint32_t dm_domid,
                                  uint32_t domid,
                                  char *phys_offset, char *node)
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 5146402..a90800d 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -371,6 +371,61 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
     libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
 }
 
+/*======================= Domain resume ========================*/
+
+int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
+{
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
+        libxl__qemu_traditional_cmd(gc, domid, "continue");
+        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
+        break;
+    }
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        if (libxl__qmp_resume(gc, domid))
+            return ERROR_FAIL;
+        break;
+    default:
+        return ERROR_INVAL;
+    }
+
+    return 0;
+}
+
+int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
+{
+    int rc = 0;
+
+    if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {
+        LOGE(ERROR, "xc_domain_resume failed for domain %u", domid);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_domain_type type = libxl__domain_type(gc, domid);
+    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    if (type == LIBXL_DOMAIN_TYPE_HVM) {
+        rc = libxl__domain_resume_device_model(gc, domid);
+        if (rc) {
+            LOG(ERROR, "failed to resume device model for domain %u:%d",
+                domid, rc);
+            goto out;
+        }
+    }
+
+    if (!xs_resume_domain(CTX->xsh, domid)) {
+        LOGE(ERROR, "xs_resume_domain failed for domain %u", domid);
+        rc = ERROR_FAIL;
+    }
+out:
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:44:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzI-0000uV-KX; Thu, 23 Jul 2015 10:44:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzH-0000uJ-7Y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:27 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	29/6C-27764-A85C0B55; Thu, 23 Jul 2015 10:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1437648264!34591895!1
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 6445 invoked from network); 23 Jul 2015 10:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzE-0007w3-Iy
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzE-00071m-EW
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:24 +0000
Date: Thu, 23 Jul 2015 10:44:24 +0000
Message-Id: <E1ZIDzE-00071m-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: move domain resume code
	into libxl_dom_suspend.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 bc3e7ff7ecdad6070f14b51fa7f6957b3e24e8a8
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 12:11:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:38 2015 +0100

    tools/libxl: move domain resume code into libxl_dom_suspend.c
    
    move domain resume code into libxl_dom_suspend.c.
    pure code move.
    
    libxl__domain_resume_device_model() will be used later by COLO,
    so we are not making this func static.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c             |   33 -----------------------
 tools/libxl/libxl_dom.c         |   20 --------------
 tools/libxl/libxl_dom_suspend.c |   55 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index dbbce17..d8343a9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -520,39 +520,6 @@ int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
-int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
-{
-    int rc = 0;
-
-    if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {
-        LOGE(ERROR, "xc_domain_resume failed for domain %u", domid);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    libxl_domain_type type = libxl__domain_type(gc, domid);
-    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        rc = libxl__domain_resume_device_model(gc, domid);
-        if (rc) {
-            LOG(ERROR, "failed to resume device model for domain %u:%d",
-                domid, rc);
-            goto out;
-        }
-    }
-
-    if (!xs_resume_domain(CTX->xsh, domid)) {
-        LOGE(ERROR, "xs_resume_domain failed for domain %u", domid);
-        rc = ERROR_FAIL;
-    }
-out:
-    return rc;
-}
-
 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
 {
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0670a8f..5db518c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1384,26 +1384,6 @@ static void switch_logdirty_done(libxl__egc *egc,
 
 /*----- callbacks, called by xc_domain_save -----*/
 
-int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
-{
-
-    switch (libxl__device_model_version_running(gc, domid)) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        libxl__qemu_traditional_cmd(gc, domid, "continue");
-        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
-        break;
-    }
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        if (libxl__qmp_resume(gc, domid))
-            return ERROR_FAIL;
-        break;
-    default:
-        return ERROR_INVAL;
-    }
-
-    return 0;
-}
-
 static inline char *physmap_path(libxl__gc *gc, uint32_t dm_domid,
                                  uint32_t domid,
                                  char *phys_offset, char *node)
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 5146402..a90800d 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -371,6 +371,61 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
     libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
 }
 
+/*======================= Domain resume ========================*/
+
+int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
+{
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
+        libxl__qemu_traditional_cmd(gc, domid, "continue");
+        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
+        break;
+    }
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        if (libxl__qmp_resume(gc, domid))
+            return ERROR_FAIL;
+        break;
+    default:
+        return ERROR_INVAL;
+    }
+
+    return 0;
+}
+
+int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
+{
+    int rc = 0;
+
+    if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {
+        LOGE(ERROR, "xc_domain_resume failed for domain %u", domid);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_domain_type type = libxl__domain_type(gc, domid);
+    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    if (type == LIBXL_DOMAIN_TYPE_HVM) {
+        rc = libxl__domain_resume_device_model(gc, domid);
+        if (rc) {
+            LOG(ERROR, "failed to resume device model for domain %u:%d",
+                domid, rc);
+            goto out;
+        }
+    }
+
+    if (!xs_resume_domain(CTX->xsh, domid)) {
+        LOGE(ERROR, "xs_resume_domain failed for domain %u", domid);
+        rc = ERROR_FAIL;
+    }
+out:
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:44:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzS-0000vu-ND; Thu, 23 Jul 2015 10:44:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzR-0000vg-0E
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:37 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	5A/57-29980-495C0B55; Thu, 23 Jul 2015 10:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1437648275!23140416!1
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 11682 invoked from network); 23 Jul 2015 10:44:35 -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;
	23 Jul 2015 10:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzO-0007wB-Ni
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzO-00072b-MB
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:34 +0000
Date: Thu, 23 Jul 2015 10:44:34 +0000
Message-Id: <E1ZIDzO-00072b-MB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: rename remus checkpoint
	callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8dd129f75b9579858205a9680ee244f5a041cdf0
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 14:12:10 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:53 2015 +0100

    tools/libxl: rename remus checkpoint callbacks
    
    There are 2 remus checkpoint callbacks(save/restore), currently, they
    both called libxl__remus_domain_checkpoint_callback in different
    files, so it is ok. But in the following patch, we will move all of the
    remus callback code into a separate file, the name should be different.
    So rename them to:
      libxl__remus_domain_{save/restore}_checkpoint_callback
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    4 ++--
 tools/libxl/libxl_dom.c    |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5b4d333..a32e3df 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -677,7 +677,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
 static void remus_checkpoint_stream_done(
     libxl__egc *egc, libxl__stream_read_state *srs, int rc);
 
-static void libxl__remus_domain_checkpoint_callback(void *data)
+static void libxl__remus_domain_restore_checkpoint_callback(void *data)
 {
     libxl__save_helper_state *shs = data;
     libxl__domain_create_state *dcs = shs->caller_state;
@@ -989,7 +989,7 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     }
 
     /* Restore */
-    callbacks->checkpoint = libxl__remus_domain_checkpoint_callback;
+    callbacks->checkpoint = libxl__remus_domain_restore_checkpoint_callback;
 
     rc = libxl__build_pre(gc, domid, d_config, state);
     if (rc)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 5db518c..3628641 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1586,7 +1586,7 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
                                   const struct timeval *requested_abs,
                                   int rc);
 
-static void libxl__remus_domain_checkpoint_callback(void *data)
+static void libxl__remus_domain_save_checkpoint_callback(void *data)
 {
     libxl__save_helper_state *shs = data;
     libxl__domain_suspend_state *dss = shs->caller_state;
@@ -1752,7 +1752,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
     if (r_info != NULL) {
         callbacks->suspend = libxl__remus_domain_suspend_callback;
         callbacks->postcopy = libxl__remus_domain_resume_callback;
-        callbacks->checkpoint = libxl__remus_domain_checkpoint_callback;
+        callbacks->checkpoint = libxl__remus_domain_save_checkpoint_callback;
         dss->sws.checkpoint_callback = remus_checkpoint_stream_written;
     } else
         callbacks->suspend = libxl__domain_suspend_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 Thu Jul 23 10:44:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzS-0000vu-ND; Thu, 23 Jul 2015 10:44:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzR-0000vg-0E
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:37 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	5A/57-29980-495C0B55; Thu, 23 Jul 2015 10:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1437648275!23140416!1
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 11682 invoked from network); 23 Jul 2015 10:44:35 -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;
	23 Jul 2015 10:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzO-0007wB-Ni
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzO-00072b-MB
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:34 +0000
Date: Thu, 23 Jul 2015 10:44:34 +0000
Message-Id: <E1ZIDzO-00072b-MB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: rename remus checkpoint
	callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8dd129f75b9579858205a9680ee244f5a041cdf0
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 14:12:10 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:08:53 2015 +0100

    tools/libxl: rename remus checkpoint callbacks
    
    There are 2 remus checkpoint callbacks(save/restore), currently, they
    both called libxl__remus_domain_checkpoint_callback in different
    files, so it is ok. But in the following patch, we will move all of the
    remus callback code into a separate file, the name should be different.
    So rename them to:
      libxl__remus_domain_{save/restore}_checkpoint_callback
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    4 ++--
 tools/libxl/libxl_dom.c    |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5b4d333..a32e3df 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -677,7 +677,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
 static void remus_checkpoint_stream_done(
     libxl__egc *egc, libxl__stream_read_state *srs, int rc);
 
-static void libxl__remus_domain_checkpoint_callback(void *data)
+static void libxl__remus_domain_restore_checkpoint_callback(void *data)
 {
     libxl__save_helper_state *shs = data;
     libxl__domain_create_state *dcs = shs->caller_state;
@@ -989,7 +989,7 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     }
 
     /* Restore */
-    callbacks->checkpoint = libxl__remus_domain_checkpoint_callback;
+    callbacks->checkpoint = libxl__remus_domain_restore_checkpoint_callback;
 
     rc = libxl__build_pre(gc, domid, d_config, state);
     if (rc)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 5db518c..3628641 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1586,7 +1586,7 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
                                   const struct timeval *requested_abs,
                                   int rc);
 
-static void libxl__remus_domain_checkpoint_callback(void *data)
+static void libxl__remus_domain_save_checkpoint_callback(void *data)
 {
     libxl__save_helper_state *shs = data;
     libxl__domain_suspend_state *dss = shs->caller_state;
@@ -1752,7 +1752,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
     if (r_info != NULL) {
         callbacks->suspend = libxl__remus_domain_suspend_callback;
         callbacks->postcopy = libxl__remus_domain_resume_callback;
-        callbacks->checkpoint = libxl__remus_domain_checkpoint_callback;
+        callbacks->checkpoint = libxl__remus_domain_save_checkpoint_callback;
         dss->sws.checkpoint_callback = remus_checkpoint_stream_written;
     } else
         callbacks->suspend = libxl__domain_suspend_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 Thu Jul 23 10:44:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzd-0000xb-Pq; Thu, 23 Jul 2015 10:44:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzb-0000xN-RM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:48 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	C6/8A-01469-F95C0B55; Thu, 23 Jul 2015 10:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1437648285!34616328!1
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 23947 invoked from network); 23 Jul 2015 10:44:46 -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;
	23 Jul 2015 10:44:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzZ-0007wJ-4f
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzY-00073I-Qu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:44 +0000
Date: Thu, 23 Jul 2015 10:44:44 +0000
Message-Id: <E1ZIDzY-00073I-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/remus: introduce
	libxl__remus_setup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2302612338e9ed5a337649f53291dc5c9fcbd74
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 14:57:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:10:00 2015 +0100

    libxl/remus: introduce libxl__remus_setup
    
    Refactoring Remus setup by introducing libxl__remus_setup API.
    All Remus setup work are done in this function.
    
    There is a subtle behavioural change here, which is that if anything
    which is now done in _setup fails then the result is a call to
    dss->callback( ..,..,ERROR_FAIL) rather than _start returning
    AO_CREATE_FAIL(ERROR_FAIL). But this is correct and intended.
    
    Also remove the libxl__ prefix for static functions.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d8343a9..312e261 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -802,10 +802,12 @@ out:
     return ptr;
 }
 
-static void libxl__remus_setup_done(libxl__egc *egc,
-                                    libxl__remus_devices_state *rds, int rc);
-static void libxl__remus_setup_failed(libxl__egc *egc,
-                                      libxl__remus_devices_state *rds, int rc);
+static void libxl__remus_setup(libxl__egc *egc,
+                               libxl__domain_suspend_state *dss);
+static void remus_setup_done(libxl__egc *egc,
+                             libxl__remus_devices_state *rds, int rc);
+static void remus_setup_failed(libxl__egc *egc,
+                               libxl__remus_devices_state *rds, int rc);
 static void remus_failover_cb(libxl__egc *egc,
                               libxl__domain_suspend_state *dss, int rc);
 
@@ -854,13 +856,26 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
 
     assert(info);
 
+    /* Point of no return */
+    libxl__remus_setup(egc, dss);
+    return AO_INPROGRESS;
+
+ out:
+    return AO_CREATE_FAIL(rc);
+}
+
+static void libxl__remus_setup(libxl__egc *egc,
+                               libxl__domain_suspend_state *dss)
+{
     /* Convenience aliases */
     libxl__remus_devices_state *const rds = &dss->rds;
+    const libxl_domain_remus_info *const info = dss->remus;
+
+    STATE_AO_GC(dss->ao);
 
     if (libxl_defbool_val(info->netbuf)) {
         if (!libxl__netbuffer_enabled(gc)) {
             LOG(ERROR, "Remus: No support for network buffering");
-            rc = ERROR_FAIL;
             goto out;
         }
         rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VIF);
@@ -870,19 +885,18 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
         rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VBD);
 
     rds->ao = ao;
-    rds->domid = domid;
-    rds->callback = libxl__remus_setup_done;
+    rds->domid = dss->domid;
+    rds->callback = remus_setup_done;
 
-    /* Point of no return */
     libxl__remus_devices_setup(egc, rds);
-    return AO_INPROGRESS;
+    return;
 
- out:
-    return AO_CREATE_FAIL(rc);
+out:
+    dss->callback(egc, dss, ERROR_FAIL);
 }
 
-static void libxl__remus_setup_done(libxl__egc *egc,
-                                    libxl__remus_devices_state *rds, int rc)
+static void remus_setup_done(libxl__egc *egc,
+                             libxl__remus_devices_state *rds, int rc)
 {
     libxl__domain_suspend_state *dss = CONTAINER_OF(rds, *dss, rds);
     STATE_AO_GC(dss->ao);
@@ -894,12 +908,12 @@ static void libxl__remus_setup_done(libxl__egc *egc,
 
     LOG(ERROR, "Remus: failed to setup device for guest with domid %u, rc %d",
         dss->domid, rc);
-    rds->callback = libxl__remus_setup_failed;
+    rds->callback = remus_setup_failed;
     libxl__remus_devices_teardown(egc, rds);
 }
 
-static void libxl__remus_setup_failed(libxl__egc *egc,
-                                      libxl__remus_devices_state *rds, int rc)
+static void remus_setup_failed(libxl__egc *egc,
+                               libxl__remus_devices_state *rds, int rc)
 {
     libxl__domain_suspend_state *dss = CONTAINER_OF(rds, *dss, rds);
     STATE_AO_GC(dss->ao);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIDzd-0000xb-Pq; Thu, 23 Jul 2015 10:44:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzb-0000xN-RM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:48 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	C6/8A-01469-F95C0B55; Thu, 23 Jul 2015 10:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1437648285!34616328!1
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 23947 invoked from network); 23 Jul 2015 10:44:46 -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;
	23 Jul 2015 10:44:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzZ-0007wJ-4f
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzY-00073I-Qu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:44 +0000
Date: Thu, 23 Jul 2015 10:44:44 +0000
Message-Id: <E1ZIDzY-00073I-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/remus: introduce
	libxl__remus_setup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2302612338e9ed5a337649f53291dc5c9fcbd74
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 14:57:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:10:00 2015 +0100

    libxl/remus: introduce libxl__remus_setup
    
    Refactoring Remus setup by introducing libxl__remus_setup API.
    All Remus setup work are done in this function.
    
    There is a subtle behavioural change here, which is that if anything
    which is now done in _setup fails then the result is a call to
    dss->callback( ..,..,ERROR_FAIL) rather than _start returning
    AO_CREATE_FAIL(ERROR_FAIL). But this is correct and intended.
    
    Also remove the libxl__ prefix for static functions.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d8343a9..312e261 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -802,10 +802,12 @@ out:
     return ptr;
 }
 
-static void libxl__remus_setup_done(libxl__egc *egc,
-                                    libxl__remus_devices_state *rds, int rc);
-static void libxl__remus_setup_failed(libxl__egc *egc,
-                                      libxl__remus_devices_state *rds, int rc);
+static void libxl__remus_setup(libxl__egc *egc,
+                               libxl__domain_suspend_state *dss);
+static void remus_setup_done(libxl__egc *egc,
+                             libxl__remus_devices_state *rds, int rc);
+static void remus_setup_failed(libxl__egc *egc,
+                               libxl__remus_devices_state *rds, int rc);
 static void remus_failover_cb(libxl__egc *egc,
                               libxl__domain_suspend_state *dss, int rc);
 
@@ -854,13 +856,26 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
 
     assert(info);
 
+    /* Point of no return */
+    libxl__remus_setup(egc, dss);
+    return AO_INPROGRESS;
+
+ out:
+    return AO_CREATE_FAIL(rc);
+}
+
+static void libxl__remus_setup(libxl__egc *egc,
+                               libxl__domain_suspend_state *dss)
+{
     /* Convenience aliases */
     libxl__remus_devices_state *const rds = &dss->rds;
+    const libxl_domain_remus_info *const info = dss->remus;
+
+    STATE_AO_GC(dss->ao);
 
     if (libxl_defbool_val(info->netbuf)) {
         if (!libxl__netbuffer_enabled(gc)) {
             LOG(ERROR, "Remus: No support for network buffering");
-            rc = ERROR_FAIL;
             goto out;
         }
         rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VIF);
@@ -870,19 +885,18 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
         rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VBD);
 
     rds->ao = ao;
-    rds->domid = domid;
-    rds->callback = libxl__remus_setup_done;
+    rds->domid = dss->domid;
+    rds->callback = remus_setup_done;
 
-    /* Point of no return */
     libxl__remus_devices_setup(egc, rds);
-    return AO_INPROGRESS;
+    return;
 
- out:
-    return AO_CREATE_FAIL(rc);
+out:
+    dss->callback(egc, dss, ERROR_FAIL);
 }
 
-static void libxl__remus_setup_done(libxl__egc *egc,
-                                    libxl__remus_devices_state *rds, int rc)
+static void remus_setup_done(libxl__egc *egc,
+                             libxl__remus_devices_state *rds, int rc)
 {
     libxl__domain_suspend_state *dss = CONTAINER_OF(rds, *dss, rds);
     STATE_AO_GC(dss->ao);
@@ -894,12 +908,12 @@ static void libxl__remus_setup_done(libxl__egc *egc,
 
     LOG(ERROR, "Remus: failed to setup device for guest with domid %u, rc %d",
         dss->domid, rc);
-    rds->callback = libxl__remus_setup_failed;
+    rds->callback = remus_setup_failed;
     libxl__remus_devices_teardown(egc, rds);
 }
 
-static void libxl__remus_setup_failed(libxl__egc *egc,
-                                      libxl__remus_devices_state *rds, int rc)
+static void remus_setup_failed(libxl__egc *egc,
+                               libxl__remus_devices_state *rds, int rc)
 {
     libxl__domain_suspend_state *dss = CONTAINER_OF(rds, *dss, rds);
     STATE_AO_GC(dss->ao);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44: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 1ZIDzm-0000zI-SV; Thu, 23 Jul 2015 10:44: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 1ZIDzl-0000z6-Iq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:57 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	11/CC-32406-8A5C0B55; Thu, 23 Jul 2015 10:44:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1437648295!28429977!1
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 27092 invoked from network); 23 Jul 2015 10:44:56 -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;
	23 Jul 2015 10:44:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzj-0007wR-8V
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzj-00073p-7b
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:55 +0000
Date: Thu, 23 Jul 2015 10:44:55 +0000
Message-Id: <E1ZIDzj-00073p-7b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/remus: introduce
	libxl__remus_teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3e886a1bb6341fb1cea2e696c8fd7e02992bace
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 15:11:38 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:10:23 2015 +0100

    libxl/remus: introduce libxl__remus_teardown
    
    introduce libxl__remus_teardown to teardown Remus devices.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl_dom.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 3628641..601d5cc 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1868,6 +1868,9 @@ static void save_device_model_datacopier_done(libxl__egc *egc,
     dss->save_dm_callback(egc, dss, our_rc);
 }
 
+static void libxl__remus_teardown(libxl__egc *egc,
+                                  libxl__domain_suspend_state *dss,
+                                  int rc);
 static void remus_teardown_done(libxl__egc *egc,
                                        libxl__remus_devices_state *rds,
                                        int rc);
@@ -1886,17 +1889,26 @@ static void domain_save_done(libxl__egc *egc,
         xc_suspend_evtchn_release(CTX->xch, CTX->xce, domid,
                            dss->guest_evtchn.port, &dss->guest_evtchn_lockfd);
 
-    if (!dss->remus) {
-        dss->callback(egc, dss, rc);
+    if (dss->remus) {
+        /*
+         * With Remus, if we reach this point, it means either
+         * backup died or some network error occurred preventing us
+         * from sending checkpoints. Teardown the network buffers and
+         * release netlink resources.  This is an async op.
+         */
+        libxl__remus_teardown(egc, dss, rc);
         return;
     }
 
-    /*
-     * With Remus, if we reach this point, it means either
-     * backup died or some network error occurred preventing us
-     * from sending checkpoints. Teardown the network buffers and
-     * release netlink resources.  This is an async op.
-     */
+    dss->callback(egc, dss, rc);
+}
+
+static void libxl__remus_teardown(libxl__egc *egc,
+                                  libxl__domain_suspend_state *dss,
+                                  int rc)
+{
+    EGC_GC;
+
     LOG(WARN, "Remus: Domain suspend terminated with rc %d,"
         " teardown Remus devices...", rc);
     dss->rds.callback = remus_teardown_done;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:44:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:44: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 1ZIDzm-0000zI-SV; Thu, 23 Jul 2015 10:44: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 1ZIDzl-0000z6-Iq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:57 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	11/CC-32406-8A5C0B55; Thu, 23 Jul 2015 10:44:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1437648295!28429977!1
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 27092 invoked from network); 23 Jul 2015 10:44:56 -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;
	23 Jul 2015 10:44:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzj-0007wR-8V
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzj-00073p-7b
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:44:55 +0000
Date: Thu, 23 Jul 2015 10:44:55 +0000
Message-Id: <E1ZIDzj-00073p-7b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/remus: introduce
	libxl__remus_teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3e886a1bb6341fb1cea2e696c8fd7e02992bace
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jul 10 15:11:38 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:10:23 2015 +0100

    libxl/remus: introduce libxl__remus_teardown
    
    introduce libxl__remus_teardown to teardown Remus devices.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl_dom.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 3628641..601d5cc 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1868,6 +1868,9 @@ static void save_device_model_datacopier_done(libxl__egc *egc,
     dss->save_dm_callback(egc, dss, our_rc);
 }
 
+static void libxl__remus_teardown(libxl__egc *egc,
+                                  libxl__domain_suspend_state *dss,
+                                  int rc);
 static void remus_teardown_done(libxl__egc *egc,
                                        libxl__remus_devices_state *rds,
                                        int rc);
@@ -1886,17 +1889,26 @@ static void domain_save_done(libxl__egc *egc,
         xc_suspend_evtchn_release(CTX->xch, CTX->xce, domid,
                            dss->guest_evtchn.port, &dss->guest_evtchn_lockfd);
 
-    if (!dss->remus) {
-        dss->callback(egc, dss, rc);
+    if (dss->remus) {
+        /*
+         * With Remus, if we reach this point, it means either
+         * backup died or some network error occurred preventing us
+         * from sending checkpoints. Teardown the network buffers and
+         * release netlink resources.  This is an async op.
+         */
+        libxl__remus_teardown(egc, dss, rc);
         return;
     }
 
-    /*
-     * With Remus, if we reach this point, it means either
-     * backup died or some network error occurred preventing us
-     * from sending checkpoints. Teardown the network buffers and
-     * release netlink resources.  This is an async op.
-     */
+    dss->callback(egc, dss, rc);
+}
+
+static void libxl__remus_teardown(libxl__egc *egc,
+                                  libxl__domain_suspend_state *dss,
+                                  int rc)
+{
+    EGC_GC;
+
     LOG(WARN, "Remus: Domain suspend terminated with rc %d,"
         " teardown Remus devices...", rc);
     dss->rds.callback = remus_teardown_done;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:45:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45: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 1ZIE01-00011N-VD; Thu, 23 Jul 2015 10:45: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 1ZIE00-000117-30
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:12 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B8/D7-29123-7B5C0B55; Thu, 23 Jul 2015 10:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648305!34596637!1
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 8362 invoked from network); 23 Jul 2015 10:45:06 -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;
	23 Jul 2015 10:45:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzt-0007xU-I5
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzt-00074o-Be
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:05 +0000
Date: Thu, 23 Jul 2015 10:45:05 +0000
Message-Id: <E1ZIDzt-00074o-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: check QEMU state before
	resume dm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43012693cf9b56efee92504016149abee016b2fa
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 16:43:30 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:18:21 2015 +0100

    tools/libxl: check QEMU state before resume dm
    
    check QEMU state before resume dm on QEMU_XEN_TRADITIONAL.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_dom_suspend.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index a90800d..4cc01ad 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -375,11 +375,19 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
 
 int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
 {
+    const char *path, *state;
 
     switch (libxl__device_model_version_running(gc, domid)) {
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        libxl__qemu_traditional_cmd(gc, domid, "continue");
-        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
+        uint32_t dm_domid = libxl_get_stubdom_id(CTX, domid);
+
+        path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
+        state = libxl__xs_read(gc, XBT_NULL, path);
+        if (state != NULL && !strcmp(state, "paused")) {
+            libxl__qemu_traditional_cmd(gc, domid, "continue");
+            libxl__wait_for_device_model_deprecated(gc, domid, "running",
+                                                    NULL, NULL, NULL);
+        }
         break;
     }
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_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 Thu Jul 23 10:45:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45: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 1ZIE01-00011N-VD; Thu, 23 Jul 2015 10:45: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 1ZIE00-000117-30
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:12 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B8/D7-29123-7B5C0B55; Thu, 23 Jul 2015 10:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648305!34596637!1
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 8362 invoked from network); 23 Jul 2015 10:45:06 -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;
	23 Jul 2015 10:45:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzt-0007xU-I5
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIDzt-00074o-Be
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:05 +0000
Date: Thu, 23 Jul 2015 10:45:05 +0000
Message-Id: <E1ZIDzt-00074o-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: check QEMU state before
	resume dm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43012693cf9b56efee92504016149abee016b2fa
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 16:43:30 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:18:21 2015 +0100

    tools/libxl: check QEMU state before resume dm
    
    check QEMU state before resume dm on QEMU_XEN_TRADITIONAL.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_dom_suspend.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index a90800d..4cc01ad 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -375,11 +375,19 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
 
 int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
 {
+    const char *path, *state;
 
     switch (libxl__device_model_version_running(gc, domid)) {
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        libxl__qemu_traditional_cmd(gc, domid, "continue");
-        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, NULL, NULL);
+        uint32_t dm_domid = libxl_get_stubdom_id(CTX, domid);
+
+        path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
+        state = libxl__xs_read(gc, XBT_NULL, path);
+        if (state != NULL && !strcmp(state, "paused")) {
+            libxl__qemu_traditional_cmd(gc, domid, "continue");
+            libxl__wait_for_device_model_deprecated(gc, domid, "running",
+                                                    NULL, NULL, NULL);
+        }
         break;
     }
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_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 Thu Jul 23 10:45:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE09-00012j-1L; Thu, 23 Jul 2015 10:45:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE07-00012Q-Dp
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:19 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	E1/CF-18676-EB5C0B55; Thu, 23 Jul 2015 10:45:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1437648317!34599887!1
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 30681 invoked from network); 23 Jul 2015 10:45:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:45:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE04-0007xi-SV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE03-00075U-L1
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:16 +0000
Date: Thu, 23 Jul 2015 10:45:15 +0000
Message-Id: <E1ZIE03-00075U-L1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Update
	libxl_domain_unpause() to support qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8db1a082bc695d71af2b69313d026ab14c96f288
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 16:45:45 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:20:21 2015 +0100

    tools/libxl: Update libxl_domain_unpause() to support qemu-xen
    
    Currently, libxl_domain_unpause() only supports
    qemu-xen-traditional. Update it to support qemu-xen.
    We use libxl__domain_resume_device_model to unpause guest dm.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 312e261..ff0d616 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1013,8 +1013,6 @@ out:
 int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    char *path;
-    char *state;
     int ret, rc = 0;
 
     libxl_domain_type type = libxl__domain_type(gc, domid);
@@ -1024,14 +1022,11 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
     }
 
     if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        uint32_t dm_domid = libxl_get_stubdom_id(ctx, domid);
-
-        path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
-        state = libxl__xs_read(gc, XBT_NULL, path);
-        if (state != NULL && !strcmp(state, "paused")) {
-            libxl__qemu_traditional_cmd(gc, domid, "continue");
-            libxl__wait_for_device_model_deprecated(gc, domid, "running",
-                                         NULL, NULL, NULL);
+        rc = libxl__domain_resume_device_model(gc, domid);
+        if (rc < 0) {
+            LOG(ERROR, "failed to unpause device model for domain %u:%d",
+                domid, rc);
+            goto out;
         }
     }
     ret = xc_domain_unpause(ctx->xch, 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 Thu Jul 23 10:45:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE09-00012j-1L; Thu, 23 Jul 2015 10:45:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE07-00012Q-Dp
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:19 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	E1/CF-18676-EB5C0B55; Thu, 23 Jul 2015 10:45:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1437648317!34599887!1
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 30681 invoked from network); 23 Jul 2015 10:45:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:45:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE04-0007xi-SV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE03-00075U-L1
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:16 +0000
Date: Thu, 23 Jul 2015 10:45:15 +0000
Message-Id: <E1ZIE03-00075U-L1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Update
	libxl_domain_unpause() to support qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8db1a082bc695d71af2b69313d026ab14c96f288
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon Jul 13 16:45:45 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:20:21 2015 +0100

    tools/libxl: Update libxl_domain_unpause() to support qemu-xen
    
    Currently, libxl_domain_unpause() only supports
    qemu-xen-traditional. Update it to support qemu-xen.
    We use libxl__domain_resume_device_model to unpause guest dm.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 312e261..ff0d616 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1013,8 +1013,6 @@ out:
 int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    char *path;
-    char *state;
     int ret, rc = 0;
 
     libxl_domain_type type = libxl__domain_type(gc, domid);
@@ -1024,14 +1022,11 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
     }
 
     if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        uint32_t dm_domid = libxl_get_stubdom_id(ctx, domid);
-
-        path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
-        state = libxl__xs_read(gc, XBT_NULL, path);
-        if (state != NULL && !strcmp(state, "paused")) {
-            libxl__qemu_traditional_cmd(gc, domid, "continue");
-            libxl__wait_for_device_model_deprecated(gc, domid, "running",
-                                         NULL, NULL, NULL);
+        rc = libxl__domain_resume_device_model(gc, domid);
+        if (rc < 0) {
+            LOG(ERROR, "failed to unpause device model for domain %u:%d",
+                domid, rc);
+            goto out;
         }
     }
     ret = xc_domain_unpause(ctx->xch, 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 Thu Jul 23 10:45:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0J-00014h-5w; Thu, 23 Jul 2015 10:45: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 1ZIE0H-00014P-MB
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:29 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	0E/10-30658-8C5C0B55; Thu, 23 Jul 2015 10:45:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648327!34596774!1
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 19629 invoked from network); 23 Jul 2015 10:45:28 -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;
	23 Jul 2015 10:45:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0F-0007xs-5R
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0E-00076R-VU
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:27 +0000
Date: Thu, 23 Jul 2015 10:45:26 +0000
Message-Id: <E1ZIE0E-00076R-VU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: gic-v3: avoid \n in the
	middle of log messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd707bceb84febe628dd8f04a33dca6690fec2f6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 17 14:21:45 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:58:08 2015 +0100

    xen: arm: gic-v3: avoid \n in the middle of log messages
    
    These result in log messages such as:
    
    (XEN) d0v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d0v0: vGICR: write r2 offset 0x000180
    (XEN)  not found<G><3>traps.c:2417:d0v0 HSR=0x93820046 pc=0xffffffc000322bfc gva=0xffffff8000090180 gpa=0x0000008d110180
    
    Fix this by rewording without a \n in the middle. Also add one at the end.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 683e3cc..f1c482d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -193,7 +193,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: read r%d offset %#08x\n not found",
+               "%pv: vGICR: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -269,7 +269,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore_32;
     default:
-        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+        printk(XENLOG_G_ERR "%pv: vGICR: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -515,7 +515,7 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               "%pv: vGICR: SGI: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -576,7 +576,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         goto write_ignore_32;
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               "%pv: vGICR: SGI: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         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 Jul 23 10:45:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0J-00014h-5w; Thu, 23 Jul 2015 10:45: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 1ZIE0H-00014P-MB
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:29 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	0E/10-30658-8C5C0B55; Thu, 23 Jul 2015 10:45:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648327!34596774!1
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 19629 invoked from network); 23 Jul 2015 10:45:28 -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;
	23 Jul 2015 10:45:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0F-0007xs-5R
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0E-00076R-VU
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:27 +0000
Date: Thu, 23 Jul 2015 10:45:26 +0000
Message-Id: <E1ZIE0E-00076R-VU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: gic-v3: avoid \n in the
	middle of log messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd707bceb84febe628dd8f04a33dca6690fec2f6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 17 14:21:45 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 14:58:08 2015 +0100

    xen: arm: gic-v3: avoid \n in the middle of log messages
    
    These result in log messages such as:
    
    (XEN) d0v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d0v0: vGICR: write r2 offset 0x000180
    (XEN)  not found<G><3>traps.c:2417:d0v0 HSR=0x93820046 pc=0xffffffc000322bfc gva=0xffffff8000090180 gpa=0x0000008d110180
    
    Fix this by rewording without a \n in the middle. Also add one at the end.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 683e3cc..f1c482d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -193,7 +193,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: read r%d offset %#08x\n not found",
+               "%pv: vGICR: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -269,7 +269,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore_32;
     default:
-        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+        printk(XENLOG_G_ERR "%pv: vGICR: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -515,7 +515,7 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               "%pv: vGICR: SGI: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         return 0;
     }
@@ -576,7 +576,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         goto write_ignore_32;
     default:
         printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               "%pv: vGICR: SGI: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
         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 Jul 23 10:45:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0S-00016B-8W; Thu, 23 Jul 2015 10:45:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0R-000165-L9
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:39 +0000
Content-Length: 1607
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	D6/3C-01469-2D5C0B55; Thu, 23 Jul 2015 10:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648337!34596838!1
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 21255 invoked from network); 23 Jul 2015 10:45:38 -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;
	23 Jul 2015 10:45:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0P-0007y0-9q
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0P-00076n-7y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:37 +0000
Date: Thu, 23 Jul 2015 10:45:37 +0000
Message-Id: <E1ZIE0P-00076n-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: include sys/endian.h for FreeBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2408866429581808641=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2408866429581808641==
Content-Length: 1189
Content-Transfer-Encoding: quoted-printable

commit 4c5cd51df95c41d3ba7f14f49c7918697971df5a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jul 20 16:55:00 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:01:12 2015 +0100

    libxl: include sys/endian.h for FreeBSD
    
    be64toh and friends are declared in sys/endian.h on FreeBSD, so include it
    as part of libxl_osdeps.h.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <ian.jackson@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/libxl/libxl_osdeps.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index 08eaf0c..b265df8 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -42,6 +42,7 @@
 #define SYSFS_PCIBACK_DRIVER   "/dev/null"
 #define NETBACK_NIC_NAME       "xnb%u.%d"
 #include <libutil.h>
+#include <sys/endian.h>
 #endif
 
 #ifndef SYSFS_PCIBACK_DRIVER
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:45:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:45:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0S-00016B-8W; Thu, 23 Jul 2015 10:45:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0R-000165-L9
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:39 +0000
Content-Length: 1607
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	D6/3C-01469-2D5C0B55; Thu, 23 Jul 2015 10:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1437648337!34596838!1
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 21255 invoked from network); 23 Jul 2015 10:45:38 -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;
	23 Jul 2015 10:45:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0P-0007y0-9q
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0P-00076n-7y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:37 +0000
Date: Thu, 23 Jul 2015 10:45:37 +0000
Message-Id: <E1ZIE0P-00076n-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: include sys/endian.h for FreeBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2408866429581808641=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2408866429581808641==
Content-Length: 1189
Content-Transfer-Encoding: quoted-printable

commit 4c5cd51df95c41d3ba7f14f49c7918697971df5a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jul 20 16:55:00 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:01:12 2015 +0100

    libxl: include sys/endian.h for FreeBSD
    
    be64toh and friends are declared in sys/endian.h on FreeBSD, so include it
    as part of libxl_osdeps.h.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <ian.jackson@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/libxl/libxl_osdeps.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index 08eaf0c..b265df8 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -42,6 +42,7 @@
 #define SYSFS_PCIBACK_DRIVER   "/dev/null"
 #define NETBACK_NIC_NAME       "xnb%u.%d"
 #include <libutil.h>
+#include <sys/endian.h>
 #endif
 
 #ifndef SYSFS_PCIBACK_DRIVER
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:45:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIE0c-00019P-P0; Thu, 23 Jul 2015 10:45:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0c-000192-0D
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:50 +0000
Content-Length: 1831
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	D2/0E-20690-CD5C0B55; Thu, 23 Jul 2015 10:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1437648347!23171043!1
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 32005 invoked from network); 23 Jul 2015 10:45:48 -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;
	23 Jul 2015 10:45:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0Z-0007yD-E6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0Z-00077d-CV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:47 +0000
Date: Thu, 23 Jul 2015 10:45:47 +0000
Message-Id: <E1ZIE0Z-00077d-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/FreeBSD: fix xendriverdomain
	rc.d script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3873842098214737019=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3873842098214737019==
Content-Length: 1416
Content-Transfer-Encoding: quoted-printable

commit 2eb3a43b2e6e08582667ad302e8ec5a7d5897611
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jul 20 16:55:02 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:01:25 2015 +0100

    hotplug/FreeBSD: fix xendriverdomain rc.d script
    
    hotplugpath.sh by default is located in /usr/local/etc/xen/scripts on
    FreeBSD. Instead of hardcoding it's location use the XEN_SCRIPT_DIR variable
    like it's used on the xencommons rc.d script.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <ian.jackson@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>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/rc.d/xendriverdomain.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
index 25e3edd..4063c06 100644
--- a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
@@ -7,7 +7,7 @@
 
 . /etc/rc.subr
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 LD_LIBRARY_PATH=3D"${libdir}"
 export LD_LIBRARY_PATH
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:45:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIE0c-00019P-P0; Thu, 23 Jul 2015 10:45:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0c-000192-0D
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:50 +0000
Content-Length: 1831
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	D2/0E-20690-CD5C0B55; Thu, 23 Jul 2015 10:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1437648347!23171043!1
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 32005 invoked from network); 23 Jul 2015 10:45:48 -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;
	23 Jul 2015 10:45:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0Z-0007yD-E6
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0Z-00077d-CV
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:47 +0000
Date: Thu, 23 Jul 2015 10:45:47 +0000
Message-Id: <E1ZIE0Z-00077d-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/FreeBSD: fix xendriverdomain
	rc.d script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3873842098214737019=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3873842098214737019==
Content-Length: 1416
Content-Transfer-Encoding: quoted-printable

commit 2eb3a43b2e6e08582667ad302e8ec5a7d5897611
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jul 20 16:55:02 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:01:25 2015 +0100

    hotplug/FreeBSD: fix xendriverdomain rc.d script
    
    hotplugpath.sh by default is located in /usr/local/etc/xen/scripts on
    FreeBSD. Instead of hardcoding it's location use the XEN_SCRIPT_DIR variable
    like it's used on the xencommons rc.d script.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <ian.jackson@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>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/rc.d/xendriverdomain.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
index 25e3edd..4063c06 100644
--- a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
@@ -7,7 +7,7 @@
 
 . /etc/rc.subr
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 LD_LIBRARY_PATH=3D"${libdir}"
 export LD_LIBRARY_PATH
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0m-0001Bx-Rm; Thu, 23 Jul 2015 10:46:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0l-0001Bh-Nq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	EC/59-12200-7E5C0B55; Thu, 23 Jul 2015 10:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1437648357!23140847!1
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 23662 invoked from network); 23 Jul 2015 10:45:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:45:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0j-0007yQ-Ib
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0j-00078M-Gr
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:57 +0000
Date: Thu, 23 Jul 2015 10:45:57 +0000
Message-Id: <E1ZIE0j-00078M-Gr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Avoid reading beyond the
	last module
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04425e40b427d9f0469d9db9321839d434a3580b
Author:     Chris (Christopher) Brand <chris.brand@broadcom.com>
AuthorDate: Fri Jul 17 20:48:08 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:08:07 2015 +0100

    xen: arm: Avoid reading beyond the last module
    
    nr_mods is set in add_boot_module() to the number of module
    array elements used. This function also ensures that nr_mods
    never exceeds MAX_MODULES (the size of the array). When looping
    through the array, the correct maximum index is "nr_mods-1",
    not "nr_mods". If the array is full, using the latter will in
    fact access beyond the end of the array.
    This was done correctly in boot_module_find_by_kind() and
    consider_modules() but incorrectly in discard_initial_modules()
    and next_module().
    
    Signed-off-by: Chris Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a46c583..6626eba 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -250,7 +250,7 @@ void __init discard_initial_modules(void)
     struct bootmodules *mi = &bootinfo.modules;
     int i;
 
-    for ( i = 0; i <= mi->nr_mods; i++ )
+    for ( i = 0; i < mi->nr_mods; i++ )
     {
         paddr_t s = mi->module[i].start;
         paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
@@ -350,7 +350,7 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end)
     paddr_t lowest = ~(paddr_t)0;
     int i;
 
-    for ( i = 0; i <= mi->nr_mods; i++ )
+    for ( i = 0; i < mi->nr_mods; i++ )
     {
         paddr_t mod_s = mi->module[i].start;
         paddr_t mod_e = mod_s + mi->module[i].size;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE0m-0001Bx-Rm; Thu, 23 Jul 2015 10:46:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0l-0001Bh-Nq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	EC/59-12200-7E5C0B55; Thu, 23 Jul 2015 10:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1437648357!23140847!1
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 23662 invoked from network); 23 Jul 2015 10:45:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:45:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0j-0007yQ-Ib
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0j-00078M-Gr
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:45:57 +0000
Date: Thu, 23 Jul 2015 10:45:57 +0000
Message-Id: <E1ZIE0j-00078M-Gr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Avoid reading beyond the
	last module
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04425e40b427d9f0469d9db9321839d434a3580b
Author:     Chris (Christopher) Brand <chris.brand@broadcom.com>
AuthorDate: Fri Jul 17 20:48:08 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:08:07 2015 +0100

    xen: arm: Avoid reading beyond the last module
    
    nr_mods is set in add_boot_module() to the number of module
    array elements used. This function also ensures that nr_mods
    never exceeds MAX_MODULES (the size of the array). When looping
    through the array, the correct maximum index is "nr_mods-1",
    not "nr_mods". If the array is full, using the latter will in
    fact access beyond the end of the array.
    This was done correctly in boot_module_find_by_kind() and
    consider_modules() but incorrectly in discard_initial_modules()
    and next_module().
    
    Signed-off-by: Chris Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a46c583..6626eba 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -250,7 +250,7 @@ void __init discard_initial_modules(void)
     struct bootmodules *mi = &bootinfo.modules;
     int i;
 
-    for ( i = 0; i <= mi->nr_mods; i++ )
+    for ( i = 0; i < mi->nr_mods; i++ )
     {
         paddr_t s = mi->module[i].start;
         paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
@@ -350,7 +350,7 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end)
     paddr_t lowest = ~(paddr_t)0;
     int i;
 
-    for ( i = 0; i <= mi->nr_mods; i++ )
+    for ( i = 0; i < mi->nr_mods; i++ )
     {
         paddr_t mod_s = mi->module[i].start;
         paddr_t mod_e = mod_s + mi->module[i].size;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIE0w-0001E7-UO; Thu, 23 Jul 2015 10:46: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 1ZIE0v-0001Dn-Uu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:10 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	75/60-32406-1F5C0B55; Thu, 23 Jul 2015 10:46:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1437648367!28615442!1
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 8865 invoked from network); 23 Jul 2015 10:46:08 -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;
	23 Jul 2015 10:46:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0t-0007z4-Mu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0t-0007AD-Lk
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:07 +0000
Date: Thu, 23 Jul 2015 10:46:07 +0000
Message-Id: <E1ZIE0t-0007AD-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make libxl__strdup and
	libxl__strndup handle NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cce28a5490c7dbeaa673f17affd1a5891c3510a4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 17 18:01:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:13:52 2015 +0100

    libxl: make libxl__strdup and libxl__strndup handle NULL
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.c |   12 ++++++++++--
 tools/libxl/libxl_internal.h |    7 +++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 24a0901..23fd751 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -161,7 +161,11 @@ char *libxl__sprintf(libxl__gc *gc, const char *fmt, ...)
 
 char *libxl__strdup(libxl__gc *gc, const char *c)
 {
-    char *s = strdup(c);
+    char *s;
+
+    if (!c) return NULL;
+
+    s = strdup(c);
 
     if (!s) libxl__alloc_failed(CTX, __func__, strlen(c), 1);
 
@@ -172,7 +176,11 @@ char *libxl__strdup(libxl__gc *gc, const char *c)
 
 char *libxl__strndup(libxl__gc *gc, const char *c, size_t n)
 {
-    char *s = strndup(c, n);
+    char *s;
+
+    if (!c) return NULL;
+
+    s = strndup(c, n);
 
     if (!s) libxl__alloc_failed(CTX, __func__, n, 1);
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 3ee9fcc..3c09668 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -608,9 +608,12 @@ _hidden void *libxl__realloc(libxl__gc *gc_opt, void *ptr, size_t new_size) NN1;
 _hidden char *libxl__sprintf(libxl__gc *gc_opt, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3) NN1;
 _hidden char *libxl__vsprintf(libxl__gc *gc, const char *format, va_list ap);
 /* duplicate the string @c (similar to a gc'd strdup(3)). */
-_hidden char *libxl__strdup(libxl__gc *gc_opt, const char *c) NN1;
+_hidden char *libxl__strdup(libxl__gc *gc_opt,
+                            const char *c /* may be NULL */) NN1;
 /* duplicate at most @n bytes of string @c (similar to a gc'd strndup(3)). */
-_hidden char *libxl__strndup(libxl__gc *gc_opt, const char *c, size_t n) NN1;
+_hidden char *libxl__strndup(libxl__gc *gc_opt,
+                             const char *c /* may be NULL */,
+                             size_t n) NN1;
 /* strip the last path component from @s and return as a newly allocated
  * string. (similar to a gc'd dirname(3)). */
 _hidden char *libxl__dirname(libxl__gc *gc_opt, const char *s) NN1;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:46:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10: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 1ZIE0w-0001E7-UO; Thu, 23 Jul 2015 10:46: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 1ZIE0v-0001Dn-Uu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:10 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	75/60-32406-1F5C0B55; Thu, 23 Jul 2015 10:46:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1437648367!28615442!1
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 8865 invoked from network); 23 Jul 2015 10:46:08 -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;
	23 Jul 2015 10:46:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0t-0007z4-Mu
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE0t-0007AD-Lk
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:07 +0000
Date: Thu, 23 Jul 2015 10:46:07 +0000
Message-Id: <E1ZIE0t-0007AD-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make libxl__strdup and
	libxl__strndup handle NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cce28a5490c7dbeaa673f17affd1a5891c3510a4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 17 18:01:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:13:52 2015 +0100

    libxl: make libxl__strdup and libxl__strndup handle NULL
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.c |   12 ++++++++++--
 tools/libxl/libxl_internal.h |    7 +++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 24a0901..23fd751 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -161,7 +161,11 @@ char *libxl__sprintf(libxl__gc *gc, const char *fmt, ...)
 
 char *libxl__strdup(libxl__gc *gc, const char *c)
 {
-    char *s = strdup(c);
+    char *s;
+
+    if (!c) return NULL;
+
+    s = strdup(c);
 
     if (!s) libxl__alloc_failed(CTX, __func__, strlen(c), 1);
 
@@ -172,7 +176,11 @@ char *libxl__strdup(libxl__gc *gc, const char *c)
 
 char *libxl__strndup(libxl__gc *gc, const char *c, size_t n)
 {
-    char *s = strndup(c, n);
+    char *s;
+
+    if (!c) return NULL;
+
+    s = strndup(c, n);
 
     if (!s) libxl__alloc_failed(CTX, __func__, n, 1);
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 3ee9fcc..3c09668 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -608,9 +608,12 @@ _hidden void *libxl__realloc(libxl__gc *gc_opt, void *ptr, size_t new_size) NN1;
 _hidden char *libxl__sprintf(libxl__gc *gc_opt, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3) NN1;
 _hidden char *libxl__vsprintf(libxl__gc *gc, const char *format, va_list ap);
 /* duplicate the string @c (similar to a gc'd strdup(3)). */
-_hidden char *libxl__strdup(libxl__gc *gc_opt, const char *c) NN1;
+_hidden char *libxl__strdup(libxl__gc *gc_opt,
+                            const char *c /* may be NULL */) NN1;
 /* duplicate at most @n bytes of string @c (similar to a gc'd strndup(3)). */
-_hidden char *libxl__strndup(libxl__gc *gc_opt, const char *c, size_t n) NN1;
+_hidden char *libxl__strndup(libxl__gc *gc_opt,
+                             const char *c /* may be NULL */,
+                             size_t n) NN1;
 /* strip the last path component from @s and return as a newly allocated
  * string. (similar to a gc'd dirname(3)). */
 _hidden char *libxl__dirname(libxl__gc *gc_opt, const char *s) NN1;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:46:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE19-0001Gv-1Z; Thu, 23 Jul 2015 10:46: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 1ZIE17-0001GV-Ce
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:21 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	F5/B4-02791-CF5C0B55; Thu, 23 Jul 2015 10:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1437648378!28502630!1
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 4735 invoked from network); 23 Jul 2015 10:46:20 -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;
	23 Jul 2015 10:46:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE13-0007zC-R4
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE13-0007Fj-PY
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:17 +0000
Date: Thu, 23 Jul 2015 10:46:17 +0000
Message-Id: <E1ZIE13-0007Fj-PY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: call libxl_cpupoolinfo_{init,
	dispose} in numa_place_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit deda96fb66a6a3db97a0f99e8c90aacc3c4e6135
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 17 18:01:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:14:06 2015 +0100

    libxl: call libxl_cpupoolinfo_{init, dispose} in numa_place_domain
    
    Call libxl_cpupoolinfo_init at the beginning.  Change two returns to
    goto out so that libxl_cpupoolinfo_dispose is called in failure path.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 601d5cc..edd7f3f 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -142,6 +142,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 
     libxl__numa_candidate_init(&candidate);
     libxl_bitmap_init(&cpupool_nodemap);
+    libxl_cpupoolinfo_init(&cpupool_info);
 
     /*
      * Extract the cpumap from the cpupool the domain belong to. In fact,
@@ -150,10 +151,10 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
      */
     rc = cpupool = libxl__domain_cpupool(gc, domid);
     if (rc < 0)
-        return rc;
+        goto out;
     rc = libxl_cpupool_info(CTX, &cpupool_info, cpupool);
     if (rc)
-        return rc;
+        goto out;
 
     rc = libxl_domain_need_memory(CTX, info, &memkb);
     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 Thu Jul 23 10:46:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE19-0001Gv-1Z; Thu, 23 Jul 2015 10:46: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 1ZIE17-0001GV-Ce
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:21 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	F5/B4-02791-CF5C0B55; Thu, 23 Jul 2015 10:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1437648378!28502630!1
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 4735 invoked from network); 23 Jul 2015 10:46:20 -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;
	23 Jul 2015 10:46:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE13-0007zC-R4
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE13-0007Fj-PY
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:17 +0000
Date: Thu, 23 Jul 2015 10:46:17 +0000
Message-Id: <E1ZIE13-0007Fj-PY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: call libxl_cpupoolinfo_{init,
	dispose} in numa_place_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit deda96fb66a6a3db97a0f99e8c90aacc3c4e6135
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 17 18:01:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:14:06 2015 +0100

    libxl: call libxl_cpupoolinfo_{init, dispose} in numa_place_domain
    
    Call libxl_cpupoolinfo_init at the beginning.  Change two returns to
    goto out so that libxl_cpupoolinfo_dispose is called in failure path.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 601d5cc..edd7f3f 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -142,6 +142,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 
     libxl__numa_candidate_init(&candidate);
     libxl_bitmap_init(&cpupool_nodemap);
+    libxl_cpupoolinfo_init(&cpupool_info);
 
     /*
      * Extract the cpumap from the cpupool the domain belong to. In fact,
@@ -150,10 +151,10 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
      */
     rc = cpupool = libxl__domain_cpupool(gc, domid);
     if (rc < 0)
-        return rc;
+        goto out;
     rc = libxl_cpupool_info(CTX, &cpupool_info, cpupool);
     if (rc)
-        return rc;
+        goto out;
 
     rc = libxl_domain_need_memory(CTX, info, &memkb);
     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 Thu Jul 23 10:46:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE1I-0001LF-3z; Thu, 23 Jul 2015 10:46: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 1ZIE1G-0001KJ-Q7
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:30 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	70/09-02952-606C0B55; Thu, 23 Jul 2015 10:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1437648388!28502698!1
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 6190 invoked from network); 23 Jul 2015 10:46:29 -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;
	23 Jul 2015 10:46:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1E-0007zK-4k
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1D-0007HD-Td
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:28 +0000
Date: Thu, 23 Jul 2015 10:46:27 +0000
Message-Id: <E1ZIE1D-0007HD-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Identify the path of the
	kernel image which cannot be found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f65a9ad05ce96d39405921b56f2d46a11337ac4a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:15 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:28:46 2015 +0100

    tools/libxc: Identify the path of the kernel image which cannot be found
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xg_private.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xg_private.c b/tools/libxc/xg_private.c
index c52cb44..507b205 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -37,7 +37,7 @@ char *xc_read_image(xc_interface *xch,
 
     if ( (kernel_fd = open(filename, O_RDONLY)) < 0 )
     {
-        PERROR("Could not open kernel image");
+        PERROR("Could not open kernel image '%s'", filename);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE1I-0001LF-3z; Thu, 23 Jul 2015 10:46: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 1ZIE1G-0001KJ-Q7
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:30 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	70/09-02952-606C0B55; Thu, 23 Jul 2015 10:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1437648388!28502698!1
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 6190 invoked from network); 23 Jul 2015 10:46:29 -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;
	23 Jul 2015 10:46:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1E-0007zK-4k
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1D-0007HD-Td
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:28 +0000
Date: Thu, 23 Jul 2015 10:46:27 +0000
Message-Id: <E1ZIE1D-0007HD-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Identify the path of the
	kernel image which cannot be found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f65a9ad05ce96d39405921b56f2d46a11337ac4a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:15 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:28:46 2015 +0100

    tools/libxc: Identify the path of the kernel image which cannot be found
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xg_private.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xg_private.c b/tools/libxc/xg_private.c
index c52cb44..507b205 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -37,7 +37,7 @@ char *xc_read_image(xc_interface *xch,
 
     if ( (kernel_fd = open(filename, O_RDONLY)) < 0 )
     {
-        PERROR("Could not open kernel image");
+        PERROR("Could not open kernel image '%s'", filename);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE1S-0001PF-7n; Thu, 23 Jul 2015 10:46: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 1ZIE1Q-0001Or-Gb
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:40 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	F7/89-22101-F06C0B55; Thu, 23 Jul 2015 10:46:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1437648398!23117987!1
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 26780 invoked from network); 23 Jul 2015 10:46:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:46:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1O-0007zS-85
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1O-0007K5-7G
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:38 +0000
Date: Thu, 23 Jul 2015 10:46:38 +0000
Message-Id: <E1ZIE1O-0007K5-7G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Log the subject fd in
	datacopier messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e07e73ac9e30dcaa5968164e8a00cedf0625fc81
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:16 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:29:03 2015 +0100

    tools/libxl: Log the subject fd in datacopier messages
    
    This is a substantial aid to debugging
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_aoutils.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 9087c23..d5fbc4d 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -188,14 +188,13 @@ void libxl__datacopier_prefixdata(libxl__egc *egc, libxl__datacopier_state *dc,
 
 static int datacopier_pollhup_handled(libxl__egc *egc,
                                       libxl__datacopier_state *dc,
-                                      short revents, int onwrite)
+                                      int fd, short revents, int onwrite)
 {
     STATE_AO_GC(dc->ao);
 
     if (dc->callback_pollhup && (revents & POLLHUP)) {
-        LOG(DEBUG, "received POLLHUP on %s during copy of %s",
-            onwrite ? dc->writewhat : dc->readwhat,
-            dc->copywhat);
+        LOG(DEBUG, "received POLLHUP on fd %d: %s during copy of %s",
+            fd, onwrite ? dc->writewhat : dc->readwhat, dc->copywhat);
         libxl__datacopier_kill(dc);
         dc->callback_pollhup(egc, dc, ERROR_FAIL, onwrite, -1);
         return 1;
@@ -217,13 +216,13 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev,
     libxl__datacopier_state *dc = CONTAINER_OF(ev, *dc, toread);
     STATE_AO_GC(dc->ao);
 
-    if (datacopier_pollhup_handled(egc, dc, revents, 0))
+    if (datacopier_pollhup_handled(egc, dc, fd, revents, 0))
         return;
 
     if (revents & ~(POLLIN|POLLHUP)) {
-        LOG(ERROR,
-            "unexpected poll event 0x%x (expected POLLIN and/or POLLHUP)"
-            " on %s during copy of %s", revents, dc->readwhat, dc->copywhat);
+        LOG(ERROR, "unexpected poll event 0x%x on fd %d (expected POLLIN "
+            "and/or POLLHUP) reading %s during copy of %s",
+            revents, fd, dc->readwhat, dc->copywhat);
         datacopier_callback(egc, dc, ERROR_FAIL, -1, EIO);
         return;
     }
@@ -286,7 +285,7 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev,
                     LIBXL__EVENT_DISASTER(egc,
      "unexpected failure polling fd for datacopier eof hup check",
                                   errno, 0);
-                if (datacopier_pollhup_handled(egc, dc, hupchk.revents, 0))
+                if (datacopier_pollhup_handled(egc, dc, fd, hupchk.revents, 0))
                     return;
             }
             libxl__ev_fd_deregister(gc, &dc->toread);
@@ -320,12 +319,13 @@ static void datacopier_writable(libxl__egc *egc, libxl__ev_fd *ev,
     libxl__datacopier_state *dc = CONTAINER_OF(ev, *dc, towrite);
     STATE_AO_GC(dc->ao);
 
-    if (datacopier_pollhup_handled(egc, dc, revents, 1))
+    if (datacopier_pollhup_handled(egc, dc, fd, revents, 1))
         return;
 
     if (revents & ~POLLOUT) {
-        LOG(ERROR, "unexpected poll event 0x%x (should be POLLOUT)"
-            " on %s during copy of %s", revents, dc->writewhat, dc->copywhat);
+        LOG(ERROR, "unexpected poll event 0x%x on fd %d (should be POLLOUT)"
+            " writing %s during copy of %s",
+            revents, fd, dc->writewhat, dc->copywhat);
         datacopier_callback(egc, dc, ERROR_FAIL, -1, EIO);
         return;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46: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 1ZIE1S-0001PF-7n; Thu, 23 Jul 2015 10:46: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 1ZIE1Q-0001Or-Gb
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:40 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	F7/89-22101-F06C0B55; Thu, 23 Jul 2015 10:46:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1437648398!23117987!1
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 26780 invoked from network); 23 Jul 2015 10:46:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:46:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1O-0007zS-85
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1O-0007K5-7G
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:38 +0000
Date: Thu, 23 Jul 2015 10:46:38 +0000
Message-Id: <E1ZIE1O-0007K5-7G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Log the subject fd in
	datacopier messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e07e73ac9e30dcaa5968164e8a00cedf0625fc81
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:16 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:29:03 2015 +0100

    tools/libxl: Log the subject fd in datacopier messages
    
    This is a substantial aid to debugging
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_aoutils.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 9087c23..d5fbc4d 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -188,14 +188,13 @@ void libxl__datacopier_prefixdata(libxl__egc *egc, libxl__datacopier_state *dc,
 
 static int datacopier_pollhup_handled(libxl__egc *egc,
                                       libxl__datacopier_state *dc,
-                                      short revents, int onwrite)
+                                      int fd, short revents, int onwrite)
 {
     STATE_AO_GC(dc->ao);
 
     if (dc->callback_pollhup && (revents & POLLHUP)) {
-        LOG(DEBUG, "received POLLHUP on %s during copy of %s",
-            onwrite ? dc->writewhat : dc->readwhat,
-            dc->copywhat);
+        LOG(DEBUG, "received POLLHUP on fd %d: %s during copy of %s",
+            fd, onwrite ? dc->writewhat : dc->readwhat, dc->copywhat);
         libxl__datacopier_kill(dc);
         dc->callback_pollhup(egc, dc, ERROR_FAIL, onwrite, -1);
         return 1;
@@ -217,13 +216,13 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev,
     libxl__datacopier_state *dc = CONTAINER_OF(ev, *dc, toread);
     STATE_AO_GC(dc->ao);
 
-    if (datacopier_pollhup_handled(egc, dc, revents, 0))
+    if (datacopier_pollhup_handled(egc, dc, fd, revents, 0))
         return;
 
     if (revents & ~(POLLIN|POLLHUP)) {
-        LOG(ERROR,
-            "unexpected poll event 0x%x (expected POLLIN and/or POLLHUP)"
-            " on %s during copy of %s", revents, dc->readwhat, dc->copywhat);
+        LOG(ERROR, "unexpected poll event 0x%x on fd %d (expected POLLIN "
+            "and/or POLLHUP) reading %s during copy of %s",
+            revents, fd, dc->readwhat, dc->copywhat);
         datacopier_callback(egc, dc, ERROR_FAIL, -1, EIO);
         return;
     }
@@ -286,7 +285,7 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev,
                     LIBXL__EVENT_DISASTER(egc,
      "unexpected failure polling fd for datacopier eof hup check",
                                   errno, 0);
-                if (datacopier_pollhup_handled(egc, dc, hupchk.revents, 0))
+                if (datacopier_pollhup_handled(egc, dc, fd, hupchk.revents, 0))
                     return;
             }
             libxl__ev_fd_deregister(gc, &dc->toread);
@@ -320,12 +319,13 @@ static void datacopier_writable(libxl__egc *egc, libxl__ev_fd *ev,
     libxl__datacopier_state *dc = CONTAINER_OF(ev, *dc, towrite);
     STATE_AO_GC(dc->ao);
 
-    if (datacopier_pollhup_handled(egc, dc, revents, 1))
+    if (datacopier_pollhup_handled(egc, dc, fd, revents, 1))
         return;
 
     if (revents & ~POLLOUT) {
-        LOG(ERROR, "unexpected poll event 0x%x (should be POLLOUT)"
-            " on %s during copy of %s", revents, dc->writewhat, dc->copywhat);
+        LOG(ERROR, "unexpected poll event 0x%x on fd %d (should be POLLOUT)"
+            " writing %s during copy of %s",
+            revents, fd, dc->writewhat, dc->copywhat);
         datacopier_callback(egc, dc, ERROR_FAIL, -1, EIO);
         return;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jul 23 10:46:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE1c-0001V6-P5; Thu, 23 Jul 2015 10:46:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1a-0001Ss-PM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	D2/1C-18947-A16C0B55; Thu, 23 Jul 2015 10:46:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1437648408!34592747!1
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 1139 invoked from network); 23 Jul 2015 10:46:49 -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;
	23 Jul 2015 10:46:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1Y-0007za-Bo
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1Y-0007Kd-Aq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:48 +0000
Date: Thu, 23 Jul 2015 10:46:48 +0000
Message-Id: <E1ZIE1Y-0007Kd-Aq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Identify copywhat in
	stream v2 datacopiers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d72befc35f31ce72ecd4564b5cf3f7a4827d8d19
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:29:16 2015 +0100

    tools/libxl: Identify copywhat in stream v2 datacopiers
    
    This is an aid to debugging
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   19 ++++++++++---------
 tools/libxl/libxl_stream_write.c |    4 +++-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 0535e7f..3e1cd2a 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -223,9 +223,10 @@ void libxl__stream_read_start(libxl__egc *egc,
     }
     /* stream->fd is now a v2 stream. */
 
-    dc->ao      = stream->ao;
-    dc->readfd  = stream->fd;
-    dc->writefd = -1;
+    dc->ao       = stream->ao;
+    dc->copywhat = "restore v2 stream";
+    dc->readfd   = stream->fd;
+    dc->writefd  = -1;
 
     /* Start reading the stream header. */
     rc = setup_read(stream, "stream header",
@@ -606,12 +607,12 @@ static void write_emulator_blob(libxl__egc *egc,
     }
 
     FILLZERO(*dc);
-    dc->ao = stream->ao;
-    dc->writewhat = "qemu save file";
-    dc->writefd = writefd;
-    dc->readfd = -1;
-    dc->maxsz = -1;
-    dc->callback = write_emulator_done;
+    dc->ao         = stream->ao;
+    dc->writewhat  = "qemu save file";
+    dc->copywhat   = "restore v2 stream";
+    dc->writefd    = writefd;
+    dc->maxsz      = -1;
+    dc->callback   = write_emulator_done;
 
     rc = libxl__datacopier_start(dc);
     if (rc)
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 96b9b07..5bff52b 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -180,7 +180,8 @@ void libxl__stream_write_start(libxl__egc *egc,
 
     dc->ao        = ao;
     dc->readfd    = -1;
-    dc->writewhat = "save/migration stream";
+    dc->writewhat = "stream header";
+    dc->copywhat  = "save v2 stream";
     dc->writefd   = stream->fd;
     dc->maxsz     = -1;
     dc->callback  = stream_header_done;
@@ -386,6 +387,7 @@ static void write_emulator_record(libxl__egc *egc,
     FILLZERO(*dc);
     dc->ao            = stream->ao;
     dc->readwhat      = "qemu save file";
+    dc->copywhat      = "save v2 stream";
     dc->readfd        = readfd;
     dc->writefd       = -1;
     dc->maxsz         = -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 Jul 23 10:46:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:46:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE1c-0001V6-P5; Thu, 23 Jul 2015 10:46:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1a-0001Ss-PM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	D2/1C-18947-A16C0B55; Thu, 23 Jul 2015 10:46:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1437648408!34592747!1
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 1139 invoked from network); 23 Jul 2015 10:46:49 -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;
	23 Jul 2015 10:46:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1Y-0007za-Bo
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1Y-0007Kd-Aq
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:48 +0000
Date: Thu, 23 Jul 2015 10:46:48 +0000
Message-Id: <E1ZIE1Y-0007Kd-Aq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Identify copywhat in
	stream v2 datacopiers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d72befc35f31ce72ecd4564b5cf3f7a4827d8d19
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 17 17:51:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 15:29:16 2015 +0100

    tools/libxl: Identify copywhat in stream v2 datacopiers
    
    This is an aid to debugging
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   19 ++++++++++---------
 tools/libxl/libxl_stream_write.c |    4 +++-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 0535e7f..3e1cd2a 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -223,9 +223,10 @@ void libxl__stream_read_start(libxl__egc *egc,
     }
     /* stream->fd is now a v2 stream. */
 
-    dc->ao      = stream->ao;
-    dc->readfd  = stream->fd;
-    dc->writefd = -1;
+    dc->ao       = stream->ao;
+    dc->copywhat = "restore v2 stream";
+    dc->readfd   = stream->fd;
+    dc->writefd  = -1;
 
     /* Start reading the stream header. */
     rc = setup_read(stream, "stream header",
@@ -606,12 +607,12 @@ static void write_emulator_blob(libxl__egc *egc,
     }
 
     FILLZERO(*dc);
-    dc->ao = stream->ao;
-    dc->writewhat = "qemu save file";
-    dc->writefd = writefd;
-    dc->readfd = -1;
-    dc->maxsz = -1;
-    dc->callback = write_emulator_done;
+    dc->ao         = stream->ao;
+    dc->writewhat  = "qemu save file";
+    dc->copywhat   = "restore v2 stream";
+    dc->writefd    = writefd;
+    dc->maxsz      = -1;
+    dc->callback   = write_emulator_done;
 
     rc = libxl__datacopier_start(dc);
     if (rc)
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 96b9b07..5bff52b 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -180,7 +180,8 @@ void libxl__stream_write_start(libxl__egc *egc,
 
     dc->ao        = ao;
     dc->readfd    = -1;
-    dc->writewhat = "save/migration stream";
+    dc->writewhat = "stream header";
+    dc->copywhat  = "save v2 stream";
     dc->writefd   = stream->fd;
     dc->maxsz     = -1;
     dc->callback  = stream_header_done;
@@ -386,6 +387,7 @@ static void write_emulator_record(libxl__egc *egc,
     FILLZERO(*dc);
     dc->ao            = stream->ao;
     dc->readwhat      = "qemu save file";
+    dc->copywhat      = "save v2 stream";
     dc->readfd        = readfd;
     dc->writefd       = -1;
     dc->maxsz         = -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 Jul 23 10:47:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE1l-0001cJ-Rr; Thu, 23 Jul 2015 10:47: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 1ZIE1k-0001bc-PW
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:00 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	3B/CC-13798-426C0B55; Thu, 23 Jul 2015 10:47:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1437648418!23118093!1
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 29496 invoked from network); 23 Jul 2015 10:46:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:46:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1i-0007zi-Fn
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1i-0007LV-EM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:58 +0000
Date: Thu, 23 Jul 2015 10:46:58 +0000
Message-Id: <E1ZIE1i-0007LV-EM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: Refix "Initialise the fd
	of the unused half of a datacopier"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1287ac109c44ca9b99eb642316d7af83b4081b52
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 16:00:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:15 2015 +0100

    tools: libxl: Refix "Initialise the fd of the unused half of a datacopier"
    
    Applying the series out of order led to d72befc35f31 "tools/libxl:
    Identify copywhat in stream v2 datacopiers" unintentionally reverting
    part of 21d9b079e538 "tools/libxl: Initialise the fd of the unused
    half of a datacopier".
    
    Put this back.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_stream_read.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 3e1cd2a..32a3551 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -611,6 +611,7 @@ static void write_emulator_blob(libxl__egc *egc,
     dc->writewhat  = "qemu save file";
     dc->copywhat   = "restore v2 stream";
     dc->writefd    = writefd;
+    dc->readfd     = -1;
     dc->maxsz      = -1;
     dc->callback   = write_emulator_done;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZIE1l-0001cJ-Rr; Thu, 23 Jul 2015 10:47: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 1ZIE1k-0001bc-PW
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:00 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	3B/CC-13798-426C0B55; Thu, 23 Jul 2015 10:47:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1437648418!23118093!1
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 29496 invoked from network); 23 Jul 2015 10:46:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:46:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1i-0007zi-Fn
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1i-0007LV-EM
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:46:58 +0000
Date: Thu, 23 Jul 2015 10:46:58 +0000
Message-Id: <E1ZIE1i-0007LV-EM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: Refix "Initialise the fd
	of the unused half of a datacopier"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1287ac109c44ca9b99eb642316d7af83b4081b52
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 21 16:00:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:15 2015 +0100

    tools: libxl: Refix "Initialise the fd of the unused half of a datacopier"
    
    Applying the series out of order led to d72befc35f31 "tools/libxl:
    Identify copywhat in stream v2 datacopiers" unintentionally reverting
    part of 21d9b079e538 "tools/libxl: Initialise the fd of the unused
    half of a datacopier".
    
    Put this back.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_stream_read.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 3e1cd2a..32a3551 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -611,6 +611,7 @@ static void write_emulator_blob(libxl__egc *egc,
     dc->writewhat  = "qemu save file";
     dc->copywhat   = "restore v2 stream";
     dc->writefd    = writefd;
+    dc->readfd     = -1;
     dc->maxsz      = -1;
     dc->callback   = write_emulator_done;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE1v-0001j3-UO; Thu, 23 Jul 2015 10:47: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 1ZIE1v-0001ik-5M
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:11 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	0D/E9-32733-E26C0B55; Thu, 23 Jul 2015 10:47:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1437648428!34578264!1
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 2562 invoked from network); 23 Jul 2015 10:47:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1s-00080J-K2
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1s-0007NU-Ir
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:08 +0000
Date: Thu, 23 Jul 2015 10:47:08 +0000
Message-Id: <E1ZIE1s-0007NU-Ir@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Adjust "Fix
	segfaults from `xl psr-cat-cbm-set`..."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e424bff91b067e0d1e8eb8f8efa38f63c822c5b2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:47 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:16 2015 +0100

    xl: Command line: Adjust "Fix segfaults from `xl psr-cat-cbm-set`..."
    
    This adjust commit a49077e5 "Fix segfaults from `xl psr-cat-cbm-set`
    command line handling":
    
     * Do not use the constant `required_argument' here (we simply use 1
       everywhere else).
    
     * Fix the minimum required arguments argument to SWITCH_FOREACH_OPT.
    
    Leave the separate check on optind, because it checks for too many as
    well as too few arguments.
    
    (There are many things in xl which fail to check for too many
    arguments.  I do not intend to drain that swamp now: I started but
    decided a complete overhaul of most of xl's command line argument
    processing would be best.)
    
    This is just a code cleanup with no ultimate functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Chao Peng <chao.p.peng@linux.intel.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8cbf30e..4e97449 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8431,7 +8431,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
     int i, j, len;
 
     static struct option opts[] = {
-        {"socket", required_argument, 0, 's'},
+        {"socket", 1, 0, 's'},
         COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
@@ -8439,7 +8439,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
     libxl_bitmap_set_none(&target_map);
 
-    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 1) {
+    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 2) {
     case 's':
         trim(isspace, optarg, &value);
         split_string_into_string_list(value, ",", &socket_list);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE1v-0001j3-UO; Thu, 23 Jul 2015 10:47: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 1ZIE1v-0001ik-5M
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:11 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	0D/E9-32733-E26C0B55; Thu, 23 Jul 2015 10:47:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1437648428!34578264!1
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 2562 invoked from network); 23 Jul 2015 10:47:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1s-00080J-K2
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE1s-0007NU-Ir
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:08 +0000
Date: Thu, 23 Jul 2015 10:47:08 +0000
Message-Id: <E1ZIE1s-0007NU-Ir@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Adjust "Fix
	segfaults from `xl psr-cat-cbm-set`..."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e424bff91b067e0d1e8eb8f8efa38f63c822c5b2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:47 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:16 2015 +0100

    xl: Command line: Adjust "Fix segfaults from `xl psr-cat-cbm-set`..."
    
    This adjust commit a49077e5 "Fix segfaults from `xl psr-cat-cbm-set`
    command line handling":
    
     * Do not use the constant `required_argument' here (we simply use 1
       everywhere else).
    
     * Fix the minimum required arguments argument to SWITCH_FOREACH_OPT.
    
    Leave the separate check on optind, because it checks for too many as
    well as too few arguments.
    
    (There are many things in xl which fail to check for too many
    arguments.  I do not intend to drain that swamp now: I started but
    decided a complete overhaul of most of xl's command line argument
    processing would be best.)
    
    This is just a code cleanup with no ultimate functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Chao Peng <chao.p.peng@linux.intel.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8cbf30e..4e97449 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8431,7 +8431,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
     int i, j, len;
 
     static struct option opts[] = {
-        {"socket", required_argument, 0, 's'},
+        {"socket", 1, 0, 's'},
         COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
@@ -8439,7 +8439,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
     libxl_bitmap_set_none(&target_map);
 
-    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 1) {
+    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 2) {
     case 's':
         trim(isspace, optarg, &value);
         split_string_into_string_list(value, ",", &socket_list);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE26-0001rF-0c; Thu, 23 Jul 2015 10:47: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 1ZIE25-0001pP-5J
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:21 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	0D/6F-10796-836C0B55; Thu, 23 Jul 2015 10:47:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1437648439!23174866!1
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 28492 invoked from network); 23 Jul 2015 10:47:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE22-00080R-UZ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE22-0007Of-NP
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:18 +0000
Date: Thu, 23 Jul 2015 10:47:18 +0000
Message-Id: <E1ZIE22-0007Of-NP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Remove maximum
	argument limit for network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb38a4e456b9365d0c60be65b6bdbad3aed75a60
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:17 2015 +0100

    xl: Command line: Remove maximum argument limit for network-attach
    
    This limit of 11 has been in this function since it was written, but
    serves no purpose.  The extra arguments are fed one by one to
    parse_nic_config, and it is possible to have as many as you like.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4e97449..c2dc928 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6398,11 +6398,6 @@ int main_networkattach(int argc, char **argv)
         /* No options */
     }
 
-    if (argc-optind > 11) {
-        help("network-attach");
-        return 0;
-    }
-
     domid = find_domain(argv[optind]);
 
     config= xlu_cfg_init(stderr, "command line");
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE26-0001rF-0c; Thu, 23 Jul 2015 10:47: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 1ZIE25-0001pP-5J
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:21 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	0D/6F-10796-836C0B55; Thu, 23 Jul 2015 10:47:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1437648439!23174866!1
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 28492 invoked from network); 23 Jul 2015 10:47:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE22-00080R-UZ
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE22-0007Of-NP
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:18 +0000
Date: Thu, 23 Jul 2015 10:47:18 +0000
Message-Id: <E1ZIE22-0007Of-NP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Remove maximum
	argument limit for network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb38a4e456b9365d0c60be65b6bdbad3aed75a60
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:17 2015 +0100

    xl: Command line: Remove maximum argument limit for network-attach
    
    This limit of 11 has been in this function since it was written, but
    serves no purpose.  The extra arguments are fed one by one to
    parse_nic_config, and it is possible to have as many as you like.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4e97449..c2dc928 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6398,11 +6398,6 @@ int main_networkattach(int argc, char **argv)
         /* No options */
     }
 
-    if (argc-optind > 11) {
-        help("network-attach");
-        return 0;
-    }
-
     domid = find_domain(argv[optind]);
 
     config= xlu_cfg_init(stderr, "command line");
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 23 10:47:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE2K-0001xI-3Q; Thu, 23 Jul 2015 10:47:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2J-0001wa-2k
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:35 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	1B/F1-21300-646C0B55; Thu, 23 Jul 2015 10:47:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1437648452!34600691!1
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 32080 invoked from network); 23 Jul 2015 10:47:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2G-00080Z-F9
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2D-0007Rt-1Y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:32 +0000
Date: Thu, 23 Jul 2015 10:47:29 +0000
Message-Id: <E1ZIE2D-0007Rt-1Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Support -h everywhere
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c60c2da3160766a265cb84c7411ff2c9cbd8d0b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:49 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:17 2015 +0100

    xl: Command line: Support -h everywhere
    
    xl subcommands ought all to take -h.  def_getopt and hence
    SWITCH_FOREACH_OPT already handles 'h' by calling helpstr.  None of
    the call sites see the 'h'.
    
    In this patch:
    
     * Change SWITCH_FOREACH_OPT to always add a "h" to the short opts
       string, using string concatenation.
    
     * Remove the now-redundant h's from some existing option strings.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c2dc928..5c6d1b0 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3098,14 +3098,15 @@ static int def_getopt(int argc, char * const argv[],
  * Wraps def_getopt into a convenient loop+switch to process all
  * arguments. This macro is intended to be called from main_XXX().
  *
- *   SWITCH_FOREACH_OPT(int *opt, const char *opts,
+ *   SWITCH_FOREACH_OPT(int *opt, "OPTS",
  *                      const struct option *longopts,
  *                      const char *commandname,
  *                      int num_opts_req) { ...
  *
  * opt:               pointer to an int variable, holds the current option
  *                    during processing.
- * opts:              short options, as per getopt_long(3)'s optstring argument.
+ * OPTS:              short options, as per getopt_long(3)'s optstring argument.
+ *                    do not include "h"; will be provided automatically
  * longopts:          long options, as per getopt_long(3)'s longopts argument.
  *                    May be null.
  * commandname:       name of this command, for usage string.
@@ -3149,7 +3150,7 @@ static int def_getopt(int argc, char * const argv[],
  */
 #define SWITCH_FOREACH_OPT(opt, opts, longopts,                         \
                            commandname, num_required_opts)              \
-    while (((opt) = def_getopt(argc, argv, (opts), (longopts),          \
+    while (((opt) = def_getopt(argc, argv, "h" opts, (longopts),          \
                                 (commandname), (num_required_opts))) != -1) \
         switch (opt)
 
@@ -3335,7 +3336,7 @@ int main_vncviewer(int argc, char **argv)
     uint32_t domid;
     int opt, autopass = 0;
 
-    SWITCH_FOREACH_OPT(opt, "ah", opts, "vncviewer", 1) {
+    SWITCH_FOREACH_OPT(opt, "a", opts, "vncviewer", 1) {
     case 'a':
         autopass = 1;
         break;
@@ -4467,7 +4468,7 @@ int main_restore(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "FhcpdeVA", opts, "restore", 1) {
+    SWITCH_FOREACH_OPT(opt, "FcpdeVA", opts, "restore", 1) {
     case 'c':
         console_autoconnect = 1;
         break;
@@ -4918,7 +4919,7 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    SWITCH_FOREACH_OPT(opt, "Fhnqf:pcdeVA", opts, "create", 0) {
+    SWITCH_FOREACH_OPT(opt, "Fnqf:pcdeVA", opts, "create", 0) {
     case 'f':
         filename = optarg;
         break;
@@ -5022,7 +5023,7 @@ int main_config_update(int argc, char **argv)
         argc--; argv++;
     }
 
-    SWITCH_FOREACH_OPT(opt, "dhqf:", opts, "config_update", 0) {
+    SWITCH_FOREACH_OPT(opt, "dqf:", opts, "config_update", 0) {
     case 'd':
         debug = 1;
         break;
@@ -5613,7 +5614,7 @@ int main_info(int argc, char **argv)
     };
     int numa = 0;
 
-    SWITCH_FOREACH_OPT(opt, "hn", opts, "info", 0) {
+    SWITCH_FOREACH_OPT(opt, "n", opts, "info", 0) {
     case 'n':
         numa = 1;
         break;
@@ -5951,7 +5952,7 @@ int main_sched_credit(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:hs", opts, "sched-credit", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:s", opts, "sched-credit", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -6067,7 +6068,7 @@ int main_sched_credit2(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:w:p:h", opts, "sched-credit2", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:w:p:", opts, "sched-credit2", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -6140,7 +6141,7 @@ int main_sched_rtds(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:p:b:c:h", opts, "sched-rtds", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:p:b:c:", opts, "sched-rtds", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -7225,7 +7226,7 @@ int main_cpupoolcreate(int argc, char **argv)
     libxl_cputopology *topology;
     int rc = 1;
 
-    SWITCH_FOREACH_OPT(opt, "hnf:", opts, "cpupool-create", 0) {
+    SWITCH_FOREACH_OPT(opt, "nf:", opts, "cpupool-create", 0) {
     case 'f':
         filename = optarg;
         break;
@@ -7416,7 +7417,7 @@ int main_cpupoollist(int argc, char **argv)
     uint32_t poolid;
     char *name;
 
-    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 0) {
+    SWITCH_FOREACH_OPT(opt, "c", opts, "cpupool-list", 0) {
     case 'c':
         opt_cpus = 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 Thu Jul 23 10:47:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2015 10:47: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 1ZIE2K-0001xI-3Q; Thu, 23 Jul 2015 10:47:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2J-0001wa-2k
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:35 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	1B/F1-21300-646C0B55; Thu, 23 Jul 2015 10:47:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1437648452!34600691!1
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 32080 invoked from network); 23 Jul 2015 10:47:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jul 2015 10:47:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2G-00080Z-F9
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZIE2D-0007Rt-1Y
	for xen-changelog@lists.xensource.com; Thu, 23 Jul 2015 10:47:32 +0000
Date: Thu, 23 Jul 2015 10:47:29 +0000
Message-Id: <E1ZIE2D-0007Rt-1Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Support -h everywhere
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c60c2da3160766a265cb84c7411ff2c9cbd8d0b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:49 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 21 16:03:17 2015 +0100

    xl: Command line: Support -h everywhere
    
    xl subcommands ought all to take -h.  def_getopt and hence
    SWITCH_FOREACH_OPT already handles 'h' by calling helpstr.  None of
    the call sites see the 'h'.
    
    In this patch:
    
     * Change SWITCH_FOREACH_OPT to always add a "h" to the short opts
       string, using string concatenation.
    
     * Remove the now-redundant h's from some existing option strings.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c2dc928..5c6d1b0 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3098,14 +3098,15 @@ static int def_getopt(int argc, char * const argv[],
  * Wraps def_getopt into a convenient loop+switch to process all
  * arguments. This macro is intended to be called from main_XXX().
  *
- *   SWITCH_FOREACH_OPT(int *opt, const char *opts,
+ *   SWITCH_FOREACH_OPT(int *opt, "OPTS",
  *                      const struct option *longopts,
  *                      const char *commandname,
  *                      int num_opts_req) { ...
  *
  * opt:               pointer to an int variable, holds the current option
  *                    during processing.
- * opts:              short options, as per getopt_long(3)'s optstring argument.
+ * OPTS:              short options, as per getopt_long(3)'s optstring argument.
+ *                    do not include "h"; will be provided automatically
  * longopts:          long options, as per getopt_long(3)'s longopts argument.
  *                    May be null.
  * commandname:       name of this command, for usage string.
@@ -3149,7 +3150,7 @@ static int def_getopt(int argc, char * const argv[],
  */
 #define SWITCH_FOREACH_OPT(opt, opts, longopts,                         \
                            commandname, num_required_opts)              \
-    while (((opt) = def_getopt(argc, argv, (opts), (longopts),          \
+    while (((opt) = def_getopt(argc, argv, "h" opts, (longopts),          \
                                 (commandname), (num_required_opts))) != -1) \
         switch (opt)
 
@@ -3335,7 +3336,7 @@ int main_vncviewer(int argc, char **argv)
     uint32_t domid;
     int opt, autopass = 0;
 
-    SWITCH_FOREACH_OPT(opt, "ah", opts, "vncviewer", 1) {
+    SWITCH_FOREACH_OPT(opt, "a", opts, "vncviewer", 1) {
     case 'a':
         autopass = 1;
         break;
@@ -4467,7 +4468,7 @@ int main_restore(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "FhcpdeVA", opts, "restore", 1) {
+    SWITCH_FOREACH_OPT(opt, "FcpdeVA", opts, "restore", 1) {
     case 'c':
         console_autoconnect = 1;
         break;
@@ -4918,7 +4919,7 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    SWITCH_FOREACH_OPT(opt, "Fhnqf:pcdeVA", opts, "create", 0) {
+    SWITCH_FOREACH_OPT(opt, "Fnqf:pcdeVA", opts, "create", 0) {
     case 'f':
         filename = optarg;
         break;
@@ -5022,7 +5023,7 @@ int main_config_update(int argc, char **argv)
         argc--; argv++;
     }
 
-    SWITCH_FOREACH_OPT(opt, "dhqf:", opts, "config_update", 0) {
+    SWITCH_FOREACH_OPT(opt, "dqf:", opts, "config_update", 0) {
     case 'd':
         debug = 1;
         break;
@@ -5613,7 +5614,7 @@ int main_info(int argc, char **argv)
     };
     int numa = 0;
 
-    SWITCH_FOREACH_OPT(opt, "hn", opts, "info", 0) {
+    SWITCH_FOREACH_OPT(opt, "n", opts, "info", 0) {
     case 'n':
         numa = 1;
         break;
@@ -5951,7 +5952,7 @@ int main_sched_credit(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:hs", opts, "sched-credit", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:s", opts, "sched-credit", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -6067,7 +6068,7 @@ int main_sched_credit2(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:w:p:h", opts, "sched-credit2", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:w:p:", opts, "sched-credit2", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -6140,7 +6141,7 @@ int main_sched_rtds(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    SWITCH_FOREACH_OPT(opt, "d:p:b:c:h", opts, "sched-rtds", 0) {
+    SWITCH_FOREACH_OPT(opt, "d:p:b:c:", opts, "sched-rtds", 0) {
     case 'd':
         dom = optarg;
         break;
@@ -7225,7 +7226,7 @@ int main_cpupoolcreate(int argc, char **argv)
     libxl_cputopology *topology;
     int rc = 1;
 
-    SWITCH_FOREACH_OPT(opt, "hnf:", opts, "cpupool-create", 0) {
+    SWITCH_FOREACH_OPT(opt, "nf:", opts, "cpupool-create", 0) {
     case 'f':
         filename = optarg;
         break;
@@ -7416,7 +7417,7 @@ int main_cpupoollist(int argc, char **argv)
     uint32_t poolid;
     char *name;
 
-    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 0) {
+    SWITCH_FOREACH_OPT(opt, "c", opts, "cpupool-list", 0) {
     case 'c':
         opt_cpus = 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 Tue Jul 28 04:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2015 04: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 1ZJwP0-0003iI-Tm; Tue, 28 Jul 2015 04:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOz-0003iD-FW
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:05 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	6D/80-13047-C6307B55; Tue, 28 Jul 2015 04:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438057322!35685765!1
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 17332 invoked from network); 28 Jul 2015 04:22:03 -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;
	28 Jul 2015 04:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOw-0002kn-EO
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOw-0008B8-Ad
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:02 +0000
Date: Tue, 28 Jul 2015 04:22:02 +0000
Message-Id: <E1ZJwOw-0008B8-Ad@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config.mk: update in-tree 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 07249f4fb80b222fc05a5a1e26d23fe50655e562
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 24 14:51:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 14:51:45 2015 +0200

    Config.mk: update in-tree OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 28e5d9a9ad8e7e1a50503ec97ce9d20cd451a5d1
    master date: 2015-06-30 16:16:47 +0100
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index f5d19ff..b73e89a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,7 +251,7 @@ 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
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
+OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.1
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
--
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 Jul 28 04:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2015 04: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 1ZJwP0-0003iI-Tm; Tue, 28 Jul 2015 04:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOz-0003iD-FW
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:05 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	6D/80-13047-C6307B55; Tue, 28 Jul 2015 04:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438057322!35685765!1
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 17332 invoked from network); 28 Jul 2015 04:22:03 -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;
	28 Jul 2015 04:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOw-0002kn-EO
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZJwOw-0008B8-Ad
	for xen-changelog@lists.xensource.com; Tue, 28 Jul 2015 04:22:02 +0000
Date: Tue, 28 Jul 2015 04:22:02 +0000
Message-Id: <E1ZJwOw-0008B8-Ad@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config.mk: update in-tree 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 07249f4fb80b222fc05a5a1e26d23fe50655e562
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jul 24 14:51:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 14:51:45 2015 +0200

    Config.mk: update in-tree OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 28e5d9a9ad8e7e1a50503ec97ce9d20cd451a5d1
    master date: 2015-06-30 16:16:47 +0100
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index f5d19ff..b73e89a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,7 +251,7 @@ 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
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
+OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.1
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
--
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 Jul 29 15:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTLz-0000AW-6R; Wed, 29 Jul 2015 15:33: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 1ZKTLx-0000AR-QV
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:09 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	E2/8D-32615-532F8B55; Wed, 29 Jul 2015 15:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438183985!24452379!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 30937 invoked from network); 29 Jul 2015 15:33: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;
	29 Jul 2015 15:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTLt-0000mh-6M
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTLt-0005Np-1p
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:05 +0000
Date: Wed, 29 Jul 2015 15:33:05 +0000
Message-Id: <E1ZKTLt-0005Np-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: Check array bounds before
	writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d18ac5938d38ed9a9d51e380a2baf8343468f65d
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:01 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTLz-0000AW-6R; Wed, 29 Jul 2015 15:33: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 1ZKTLx-0000AR-QV
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:09 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	E2/8D-32615-532F8B55; Wed, 29 Jul 2015 15:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438183985!24452379!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 30937 invoked from network); 29 Jul 2015 15:33: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;
	29 Jul 2015 15:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTLt-0000mh-6M
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTLt-0005Np-1p
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:05 +0000
Date: Wed, 29 Jul 2015 15:33:05 +0000
Message-Id: <E1ZKTLt-0005Np-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: Check array bounds before
	writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d18ac5938d38ed9a9d51e380a2baf8343468f65d
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:01 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTM7-0000B3-8l; Wed, 29 Jul 2015 15:33:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM6-0000Ax-5s
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:18 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	E8/C5-09570-D32F8B55; Wed, 29 Jul 2015 15:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438183995!30452034!1
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 4306 invoked from network); 29 Jul 2015 15:33:16 -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;
	29 Jul 2015 15:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM3-0000ml-Kw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM3-0005Qu-IT
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:15 +0000
Date: Wed, 29 Jul 2015 15:33:15 +0000
Message-Id: <E1ZKTM3-0005Qu-IT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: Clear DRQ after handling
	all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f057440b31da38196e3398fd1b618fc36ad97d6
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:02 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTM7-0000B3-8l; Wed, 29 Jul 2015 15:33:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM6-0000Ax-5s
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:18 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	E8/C5-09570-D32F8B55; Wed, 29 Jul 2015 15:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438183995!30452034!1
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 4306 invoked from network); 29 Jul 2015 15:33:16 -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;
	29 Jul 2015 15:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM3-0000ml-Kw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTM3-0005Qu-IT
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:33:15 +0000
Date: Wed, 29 Jul 2015 15:33:15 +0000
Message-Id: <E1ZKTM3-0005Qu-IT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: Clear DRQ after handling
	all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f057440b31da38196e3398fd1b618fc36ad97d6
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:02 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTWg-0000fX-Em; Wed, 29 Jul 2015 15:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWe-0000fS-VS
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:13 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	9B/2F-32641-CC4F8B55; Wed, 29 Jul 2015 15:44:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438184650!30376587!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 15922 invoked from network); 29 Jul 2015 15:44:11 -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;
	29 Jul 2015 15:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWc-0000uT-65
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWc-000666-3W
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:10 +0000
Date: Wed, 29 Jul 2015 15:44:10 +0000
Message-Id: <E1ZKTWc-000666-3W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cec11fdfb212fb5493cdd44b81f1642758eeb869
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:35:03 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
    (cherry picked from commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2)
    (cherry picked from commit 70add61d0c6f7c79b74ed016a0531e40f0cc00b3)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTWg-0000fX-Em; Wed, 29 Jul 2015 15:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWe-0000fS-VS
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:13 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	9B/2F-32641-CC4F8B55; Wed, 29 Jul 2015 15:44:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438184650!30376587!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 15922 invoked from network); 29 Jul 2015 15:44:11 -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;
	29 Jul 2015 15:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWc-0000uT-65
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWc-000666-3W
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:10 +0000
Date: Wed, 29 Jul 2015 15:44:10 +0000
Message-Id: <E1ZKTWc-000666-3W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cec11fdfb212fb5493cdd44b81f1642758eeb869
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:35:03 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
    (cherry picked from commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2)
    (cherry picked from commit 70add61d0c6f7c79b74ed016a0531e40f0cc00b3)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15: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 1ZKTWq-0000gM-Hh; Wed, 29 Jul 2015 15: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 1ZKTWo-0000gE-U6
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:23 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	CF/A6-29649-6D4F8B55; Wed, 29 Jul 2015 15:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438184660!29177665!1
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 32628 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWm-0000ub-EM
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWm-00066e-Bw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:20 +0000
Date: Wed, 29 Jul 2015 15:44:20 +0000
Message-Id: <E1ZKTWm-00066e-Bw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbde16cd1c9866a92a7a449e7df5637dd7c3e9cc
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:35:06 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
    (cherry picked from commit 30c002bffcd6287a7d5bb4e2c691b101c0937013)
    (cherry picked from commit e1db2596d7c5f8be876481148d407f0cb207b494)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15: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 1ZKTWq-0000gM-Hh; Wed, 29 Jul 2015 15: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 1ZKTWo-0000gE-U6
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:23 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	CF/A6-29649-6D4F8B55; Wed, 29 Jul 2015 15:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438184660!29177665!1
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 32628 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWm-0000ub-EM
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWm-00066e-Bw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:20 +0000
Date: Wed, 29 Jul 2015 15:44:20 +0000
Message-Id: <E1ZKTWm-00066e-Bw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbde16cd1c9866a92a7a449e7df5637dd7c3e9cc
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:35:06 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
    (cherry picked from commit 30c002bffcd6287a7d5bb4e2c691b101c0937013)
    (cherry picked from commit e1db2596d7c5f8be876481148d407f0cb207b494)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTX3-0000hW-KH; Wed, 29 Jul 2015 15:44: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 1ZKTX2-0000hP-79
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:36 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	B2/69-01143-3E4F8B55; Wed, 29 Jul 2015 15:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438184673!36241121!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 11989 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWz-0000um-0U
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWy-00067o-Rr
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:32 +0000
Date: Wed, 29 Jul 2015 15:44:32 +0000
Message-Id: <E1ZKTWy-00067o-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70add61d0c6f7c79b74ed016a0531e40f0cc00b3
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:34:34 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
    (cherry picked from commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTX3-0000hW-KH; Wed, 29 Jul 2015 15:44: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 1ZKTX2-0000hP-79
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:36 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	B2/69-01143-3E4F8B55; Wed, 29 Jul 2015 15:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438184673!36241121!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 11989 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWz-0000um-0U
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTWy-00067o-Rr
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:32 +0000
Date: Wed, 29 Jul 2015 15:44:32 +0000
Message-Id: <E1ZKTWy-00067o-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70add61d0c6f7c79b74ed016a0531e40f0cc00b3
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:34:34 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
    (cherry picked from commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTXD-0000ik-Mz; Wed, 29 Jul 2015 15:44: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 1ZKTXC-0000id-Qo
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:46 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	12/09-05979-DE4F8B55; Wed, 29 Jul 2015 15:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438184684!30482141!1
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 19723 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTX9-0000uu-Vd
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTX9-00068M-4O
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:43 +0000
Date: Wed, 29 Jul 2015 15:44:43 +0000
Message-Id: <E1ZKTX9-00068M-4O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1db2596d7c5f8be876481148d407f0cb207b494
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:34:36 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
    (cherry picked from commit 30c002bffcd6287a7d5bb4e2c691b101c0937013)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTXD-0000ik-Mz; Wed, 29 Jul 2015 15:44: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 1ZKTXC-0000id-Qo
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:46 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	12/09-05979-DE4F8B55; Wed, 29 Jul 2015 15:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438184684!30482141!1
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 19723 invoked from network); 29 Jul 2015 15:44: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;
	29 Jul 2015 15:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTX9-0000uu-Vd
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTX9-00068M-4O
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:43 +0000
Date: Wed, 29 Jul 2015 15:44:43 +0000
Message-Id: <E1ZKTX9-00068M-4O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1db2596d7c5f8be876481148d407f0cb207b494
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:34:36 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
    (cherry picked from commit 30c002bffcd6287a7d5bb4e2c691b101c0937013)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTXP-0000k4-Pa; Wed, 29 Jul 2015 15:44:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXP-0000jx-3J
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:59 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	34/B7-02324-AF4F8B55; Wed, 29 Jul 2015 15:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1438184696!16902765!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 19653 invoked from network); 29 Jul 2015 15:44:57 -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;
	29 Jul 2015 15:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXM-0000v6-O9
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXM-00069F-L8
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:56 +0000
Date: Wed, 29 Jul 2015 15:44:56 +0000
Message-Id: <E1ZKTXM-00069F-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:52 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:44:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:44: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 1ZKTXP-0000k4-Pa; Wed, 29 Jul 2015 15:44:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXP-0000jx-3J
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:59 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	34/B7-02324-AF4F8B55; Wed, 29 Jul 2015 15:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1438184696!16902765!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 19653 invoked from network); 29 Jul 2015 15:44:57 -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;
	29 Jul 2015 15:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXM-0000v6-O9
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXM-00069F-L8
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:44:56 +0000
Date: Wed, 29 Jul 2015 15:44:56 +0000
Message-Id: <E1ZKTXM-00069F-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb745741f519e6cf60a455bfba62a1acc0b5cfe2
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:52 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45: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 1ZKTXc-0000m6-UC; Wed, 29 Jul 2015 15:45:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXb-0000lx-Vb
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:12 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	59/0F-12371-705F8B55; Wed, 29 Jul 2015 15:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438184709!36307759!1
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 15502 invoked from network); 29 Jul 2015 15:45:10 -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;
	29 Jul 2015 15:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXW-0000w9-VN
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXW-00069z-Ss
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:06 +0000
Date: Wed, 29 Jul 2015 15:45:06 +0000
Message-Id: <E1ZKTXW-00069z-Ss@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30c002bffcd6287a7d5bb4e2c691b101c0937013
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:53 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45: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 1ZKTXc-0000m6-UC; Wed, 29 Jul 2015 15:45:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXb-0000lx-Vb
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:12 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	59/0F-12371-705F8B55; Wed, 29 Jul 2015 15:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438184709!36307759!1
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 15502 invoked from network); 29 Jul 2015 15:45:10 -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;
	29 Jul 2015 15:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXW-0000w9-VN
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXW-00069z-Ss
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:06 +0000
Date: Wed, 29 Jul 2015 15:45:06 +0000
Message-Id: <E1ZKTXW-00069z-Ss@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30c002bffcd6287a7d5bb4e2c691b101c0937013
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:53 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTXq-0000nM-0b; Wed, 29 Jul 2015 15:45:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXo-0000nD-N1
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:24 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	35/ED-17885-415F8B55; Wed, 29 Jul 2015 15:45:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438184722!19068899!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 12058 invoked from network); 29 Jul 2015 15:45:23 -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;
	29 Jul 2015 15:45:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXm-0000wH-Aw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXm-0006Bu-75
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:22 +0000
Date: Wed, 29 Jul 2015 15:45:22 +0000
Message-Id: <E1ZKTXm-0006Bu-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ded5f4b399b3c1e13ea15e7657d0a88b6e26643
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:10 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTXq-0000nM-0b; Wed, 29 Jul 2015 15:45:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXo-0000nD-N1
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:24 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	35/ED-17885-415F8B55; Wed, 29 Jul 2015 15:45:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438184722!19068899!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 12058 invoked from network); 29 Jul 2015 15:45:23 -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;
	29 Jul 2015 15:45:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXm-0000wH-Aw
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXm-0006Bu-75
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:22 +0000
Date: Wed, 29 Jul 2015 15:45:22 +0000
Message-Id: <E1ZKTXm-0006Bu-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] ide: Check array bounds
	before writing to io_buffer (CVE-2015-5154)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ded5f4b399b3c1e13ea15e7657d0a88b6e26643
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:13:31 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:10 2015 +0100

    ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
    
    If the end_transfer_func of a command is called because enough data has
    been read or written for the current PIO transfer, and it fails to
    correctly call the command completion functions, the DRQ bit in the
    status register and s->end_transfer_func may remain set. This allows the
    guest to access further bytes in s->io_buffer beyond s->data_end, and
    eventually overflowing the io_buffer.
    
    One case where this currently happens is emulation of the ATAPI command
    START STOP UNIT.
    
    This patch fixes the problem by adding explicit array bounds checks
    before accessing the buffer instead of relying on end_transfer_func to
    function correctly.
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d18ac5938d38ed9a9d51e380a2baf8343468f65d)
---
 hw/ide.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 791666b..211ec88 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3002,6 +3002,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return;
+    }
+
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
@@ -3021,6 +3025,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 2);
 
     p = s->data_ptr;
+    if (p + 2 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
@@ -3040,6 +3048,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     buffered_pio_write(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return;
+    }
+
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
@@ -3059,6 +3071,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     buffered_pio_read(s, addr, 4);
 
     p = s->data_ptr;
+    if (p + 4 > s->data_end) {
+        return 0;
+    }
+
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTY1-0000oi-3E; Wed, 29 Jul 2015 15:45:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXz-0000oW-Tu
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:36 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	5F/00-22089-F15F8B55; Wed, 29 Jul 2015 15:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1438184733!20354772!1
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 20702 invoked from network); 29 Jul 2015 15:45:34 -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;
	29 Jul 2015 15:45:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXx-0000wO-EG
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXw-0006CH-G4
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:32 +0000
Date: Wed, 29 Jul 2015 15:45:32 +0000
Message-Id: <E1ZKTXw-0006CH-G4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 327319a1e9bb79996e8de4df78ccde25e87692e2
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:12 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Jul 29 15:45:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2015 15:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZKTY1-0000oi-3E; Wed, 29 Jul 2015 15:45:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXz-0000oW-Tu
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:36 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	5F/00-22089-F15F8B55; Wed, 29 Jul 2015 15:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1438184733!20354772!1
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 20702 invoked from network); 29 Jul 2015 15:45:34 -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;
	29 Jul 2015 15:45:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXx-0000wO-EG
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZKTXw-0006CH-G4
	for xen-changelog@lists.xensource.com; Wed, 29 Jul 2015 15:45:32 +0000
Date: Wed, 29 Jul 2015 15:45:32 +0000
Message-Id: <E1ZKTXw-0006CH-G4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] ide: Clear DRQ after
	handling all expected accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 327319a1e9bb79996e8de4df78ccde25e87692e2
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Wed Jun 3 14:41:27 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:33:12 2015 +0100

    ide: Clear DRQ after handling all expected accesses
    
    This is additional hardening against an end_transfer_func that fails to
    clear the DRQ status bit. The bit must be unset as soon as the PIO
    transfer has completed, so it's better to do this in a central place
    instead of duplicating the code in all commands (and forgetting it in
    some).
    
    [ This is XSA-138 / CVE-2015-5154. ]
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7f057440b31da38196e3398fd1b618fc36ad97d6)
---
 hw/ide.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 211ec88..7b84d1b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3009,8 +3009,10 @@ static void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
     *(uint16_t *)p = le16_to_cpu(val);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readw(void *opaque, uint32_t addr)
@@ -3032,8 +3034,10 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr)
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
@@ -3055,8 +3059,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
 }
 
 static uint32_t ide_data_readl(void *opaque, uint32_t addr)
@@ -3078,8 +3084,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr)
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;
     s->data_ptr = p;
-    if (p >= s->data_end)
+    if (p >= s->data_end) {
+        s->status &= ~DRQ_STAT;
         s->end_transfer_func(s);
+    }
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAQt-0004lB-Tm; Fri, 31 Jul 2015 13:33: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 1ZLAQt-0004l5-Br
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:07 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	BE/45-25435-2197BB55; Fri, 31 Jul 2015 13:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1438349584!36917861!1
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 2058 invoked from network); 31 Jul 2015 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAQq-0004Mx-Qo
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAQq-0006cL-OC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:04 +0000
Date: Fri, 31 Jul 2015 13:33:04 +0000
Message-Id: <E1ZLAQq-0006cL-OC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix build with glibc < 2.9
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23d72aaa0ccb206b0447b1efa9f1012f093162ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 22 14:15:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 14:15:12 2015 +0200

    libxl: fix build with glibc < 2.9
    
    htobe*() and be*toh() don't exist there. While replacing the 32-bit
    ones with hton() and ntoh() would be possible, there wouldn't be an
    obvious replacement for the 64-bit ones. Hence just take what current
    glibc (2.21) has (assuming __bswap_*() exists, which it does back to
    at least 2.4 according to my checking).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_osdeps.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index b265df8..d9661c9 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -59,6 +59,42 @@ int asprintf(char **buffer, char *fmt, ...);
 int vasprintf(char **buffer, const char *fmt, va_list ap);
 #endif /*NEED_OWN_ASPRINTF*/
 
+#ifndef htobe32 /* glibc < 2.9 */
+# include <byteswap.h>
+
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define htobe16(x) __bswap_16(x)
+#  define htole16(x) (x)
+#  define be16toh(x) __bswap_16(x)
+#  define le16toh(x) (x)
+
+#  define htobe32(x) __bswap_32(x)
+#  define htole32(x) (x)
+#  define be32toh(x) __bswap_32(x)
+#  define le32toh(x) (x)
+
+#  define htobe64(x) __bswap_64(x)
+#  define htole64(x) (x)
+#  define be64toh(x) __bswap_64(x)
+#  define le64toh(x) (x)
+# else
+#  define htobe16(x) (x)
+#  define htole16(x) __bswap_16(x)
+#  define be16toh(x) (x)
+#  define le16toh(x) __bswap_16(x)
+
+#  define htobe32(x) (x)
+#  define htole32(x) __bswap_32(x)
+#  define be32toh(x) (x)
+#  define le32toh(x) __bswap_32(x)
+
+#  define htobe64(x) (x)
+#  define htole64(x) __bswap_64(x)
+#  define be64toh(x) (x)
+#  define le64toh(x) __bswap_64(x)
+# endif
+#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 Jul 31 13:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAQt-0004lB-Tm; Fri, 31 Jul 2015 13:33: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 1ZLAQt-0004l5-Br
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:07 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	BE/45-25435-2197BB55; Fri, 31 Jul 2015 13:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1438349584!36917861!1
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 2058 invoked from network); 31 Jul 2015 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAQq-0004Mx-Qo
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAQq-0006cL-OC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:04 +0000
Date: Fri, 31 Jul 2015 13:33:04 +0000
Message-Id: <E1ZLAQq-0006cL-OC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix build with glibc < 2.9
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23d72aaa0ccb206b0447b1efa9f1012f093162ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 22 14:15:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 14:15:12 2015 +0200

    libxl: fix build with glibc < 2.9
    
    htobe*() and be*toh() don't exist there. While replacing the 32-bit
    ones with hton() and ntoh() would be possible, there wouldn't be an
    obvious replacement for the 64-bit ones. Hence just take what current
    glibc (2.21) has (assuming __bswap_*() exists, which it does back to
    at least 2.4 according to my checking).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_osdeps.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index b265df8..d9661c9 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -59,6 +59,42 @@ int asprintf(char **buffer, char *fmt, ...);
 int vasprintf(char **buffer, const char *fmt, va_list ap);
 #endif /*NEED_OWN_ASPRINTF*/
 
+#ifndef htobe32 /* glibc < 2.9 */
+# include <byteswap.h>
+
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define htobe16(x) __bswap_16(x)
+#  define htole16(x) (x)
+#  define be16toh(x) __bswap_16(x)
+#  define le16toh(x) (x)
+
+#  define htobe32(x) __bswap_32(x)
+#  define htole32(x) (x)
+#  define be32toh(x) __bswap_32(x)
+#  define le32toh(x) (x)
+
+#  define htobe64(x) __bswap_64(x)
+#  define htole64(x) (x)
+#  define be64toh(x) __bswap_64(x)
+#  define le64toh(x) (x)
+# else
+#  define htobe16(x) (x)
+#  define htole16(x) __bswap_16(x)
+#  define be16toh(x) (x)
+#  define le16toh(x) __bswap_16(x)
+
+#  define htobe32(x) (x)
+#  define htole32(x) __bswap_32(x)
+#  define be32toh(x) (x)
+#  define le32toh(x) __bswap_32(x)
+
+#  define htobe64(x) (x)
+#  define htole64(x) __bswap_64(x)
+#  define be64toh(x) (x)
+#  define le64toh(x) __bswap_64(x)
+# endif
+#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 Jul 31 13:33:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARA-0004mO-1W; Fri, 31 Jul 2015 13:33: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 1ZLAR9-0004mF-6O
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:23 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	FF/74-15055-2297BB55; Fri, 31 Jul 2015 13:33:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349598!31102854!1
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 25510 invoked from network); 31 Jul 2015 13:33:21 -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;
	31 Jul 2015 13:33:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAR1-0004N3-2z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAR0-0006cr-U7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:15 +0000
Date: Fri, 31 Jul 2015 13:33:14 +0000
Message-Id: <E1ZLAR0-0006cr-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/psr: remove invalid cpu_to_socket
	call
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc299d01b925d934219b6e8c29fadcd1f1a9210b
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Wed Jul 22 14:15:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 14:15:37 2015 +0200

    x86/psr: remove invalid cpu_to_socket call
    
    cpu_to_socket() can't give correct socket value in CPU_PREPARE notifier
    as at that time phys_proc_id has not yet been initialized (the value is
    its default 0 in this case) which is incorrect for sockets other than
    socket 0.
    
    cos_to_cbm now is pre-allocated in CPU_PREPARE notifier and then consumed
    in CPU_STARTING notifier.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 xen/arch/x86/psr.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 861683f..ed59803 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -50,6 +50,8 @@ static unsigned int __read_mostly opt_cos_max = 255;
 static uint64_t rmid_mask;
 static DEFINE_PER_CPU(struct psr_assoc, psr_assoc);
 
+static struct psr_cat_cbm *temp_cos_to_cbm;
+
 static unsigned int get_socket_cpu(unsigned int socket)
 {
     if ( likely(socket < nr_sockets) )
@@ -451,22 +453,15 @@ void psr_domain_free(struct domain *d)
 
 static int cat_cpu_prepare(unsigned int cpu)
 {
-    struct psr_cat_socket_info *info;
-    unsigned int socket;
-
     if ( !cat_socket_info )
         return 0;
 
-    socket = cpu_to_socket(cpu);
-    if ( socket >= nr_sockets )
-        return -ENOSPC;
-
-    info = cat_socket_info + socket;
-    if ( info->cos_to_cbm )
-        return 0;
+    if ( temp_cos_to_cbm == NULL &&
+         (temp_cos_to_cbm = xzalloc_array(struct psr_cat_cbm,
+                                          opt_cos_max + 1UL)) == NULL )
+        return -ENOMEM;
 
-    info->cos_to_cbm = xzalloc_array(struct psr_cat_cbm, opt_cos_max + 1UL);
-    return info->cos_to_cbm ? 0 : -ENOMEM;
+    return 0;
 }
 
 static void cat_cpu_init(void)
@@ -492,6 +487,8 @@ static void cat_cpu_init(void)
         info->cbm_len = (eax & 0x1f) + 1;
         info->cos_max = min(opt_cos_max, edx & 0xffff);
 
+        info->cos_to_cbm = temp_cos_to_cbm;
+        temp_cos_to_cbm = NULL;
         /* cos=0 is reserved as default cbm(all ones). */
         info->cos_to_cbm[0].cbm = (1ull << info->cbm_len) - 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 Jul 31 13:33:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARA-0004mO-1W; Fri, 31 Jul 2015 13:33: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 1ZLAR9-0004mF-6O
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:23 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	FF/74-15055-2297BB55; Fri, 31 Jul 2015 13:33:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349598!31102854!1
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 25510 invoked from network); 31 Jul 2015 13:33:21 -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;
	31 Jul 2015 13:33:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAR1-0004N3-2z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAR0-0006cr-U7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:15 +0000
Date: Fri, 31 Jul 2015 13:33:14 +0000
Message-Id: <E1ZLAR0-0006cr-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/psr: remove invalid cpu_to_socket
	call
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc299d01b925d934219b6e8c29fadcd1f1a9210b
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Wed Jul 22 14:15:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 14:15:37 2015 +0200

    x86/psr: remove invalid cpu_to_socket call
    
    cpu_to_socket() can't give correct socket value in CPU_PREPARE notifier
    as at that time phys_proc_id has not yet been initialized (the value is
    its default 0 in this case) which is incorrect for sockets other than
    socket 0.
    
    cos_to_cbm now is pre-allocated in CPU_PREPARE notifier and then consumed
    in CPU_STARTING notifier.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 xen/arch/x86/psr.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 861683f..ed59803 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -50,6 +50,8 @@ static unsigned int __read_mostly opt_cos_max = 255;
 static uint64_t rmid_mask;
 static DEFINE_PER_CPU(struct psr_assoc, psr_assoc);
 
+static struct psr_cat_cbm *temp_cos_to_cbm;
+
 static unsigned int get_socket_cpu(unsigned int socket)
 {
     if ( likely(socket < nr_sockets) )
@@ -451,22 +453,15 @@ void psr_domain_free(struct domain *d)
 
 static int cat_cpu_prepare(unsigned int cpu)
 {
-    struct psr_cat_socket_info *info;
-    unsigned int socket;
-
     if ( !cat_socket_info )
         return 0;
 
-    socket = cpu_to_socket(cpu);
-    if ( socket >= nr_sockets )
-        return -ENOSPC;
-
-    info = cat_socket_info + socket;
-    if ( info->cos_to_cbm )
-        return 0;
+    if ( temp_cos_to_cbm == NULL &&
+         (temp_cos_to_cbm = xzalloc_array(struct psr_cat_cbm,
+                                          opt_cos_max + 1UL)) == NULL )
+        return -ENOMEM;
 
-    info->cos_to_cbm = xzalloc_array(struct psr_cat_cbm, opt_cos_max + 1UL);
-    return info->cos_to_cbm ? 0 : -ENOMEM;
+    return 0;
 }
 
 static void cat_cpu_init(void)
@@ -492,6 +487,8 @@ static void cat_cpu_init(void)
         info->cbm_len = (eax & 0x1f) + 1;
         info->cos_max = min(opt_cos_max, edx & 0xffff);
 
+        info->cos_to_cbm = temp_cos_to_cbm;
+        temp_cos_to_cbm = NULL;
         /* cos=0 is reserved as default cbm(all ones). */
         info->cos_to_cbm[0].cbm = (1ull << info->cbm_len) - 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 Jul 31 13:33:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARF-0004nP-3w; Fri, 31 Jul 2015 13:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARD-0004n9-UK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:28 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	B3/46-25435-7297BB55; Fri, 31 Jul 2015 13:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438349605!25486519!1
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 16232 invoked from network); 31 Jul 2015 13:33:26 -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;
	31 Jul 2015 13:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARB-0004NB-90
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARB-0006dM-7a
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:25 +0000
Date: Fri, 31 Jul 2015 13:33:25 +0000
Message-Id: <E1ZLARB-0006dM-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix vcpus to vnode assignement in
	config 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 a08b914807b14a8328d005079d774e7f8efd1d24
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 19:31:57 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 22 15:16:56 2015 +0100

    xl: fix vcpus to vnode assignement in config file
    
    In fact, right now, the following (legitimate)
    configuration:
    
     vcpus       = '4'
     vnuma = [ [ "pnode=0","size=512","vcpus=0,1","vdistances=10,20"  ],
               [ "pnode=1","size=512","vcpus=2,3","vdistances=20,10"  ] ]
    
    Produces the following error:
    
     # xl create /etc/xen/test.cfg
     Parsing config from /etc/xen/test.cfg
     xl: maxvcpus < vcpu
    
    That is because, we only process the first element of the
    "vcpus=" list (of each vnode specification). Therefore,
    in the above case, we only see 2 vcpus, out of 4, being
    assigned to the vnodes, and hence the error.
    
    What we need is either a multidimentional array, or a
    bitmap, to temporary store the vcpus of a vnode, while
    parsing the vnuma config entry. Let's use the latter,
    which happens to also make it easier to copy the outcome
    of the parsing to its final destination in b_info, if
    everything goes ok.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5c6d1b0..1d45dd5 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1076,9 +1076,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     /* Temporary storage for parsed vcpus information to avoid
      * parsing config twice. This array has num_vnuma elements.
      */
-    struct vcpu_range_parsed {
-        unsigned long start, end;
-    } *vcpu_range_parsed;
+    libxl_bitmap *vcpu_parsed;
 
     libxl_physinfo_init(&physinfo);
     if (libxl_get_physinfo(ctx, &physinfo) != 0) {
@@ -1095,7 +1093,14 @@ static void parse_vnuma_config(const XLU_Config *config,
 
     b_info->num_vnuma_nodes = num_vnuma;
     b_info->vnuma_nodes = xcalloc(num_vnuma, sizeof(libxl_vnode_info));
-    vcpu_range_parsed = xcalloc(num_vnuma, sizeof(*vcpu_range_parsed));
+    vcpu_parsed = xcalloc(num_vnuma, sizeof(libxl_bitmap));
+    for (i = 0; i < num_vnuma; i++) {
+        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);
+        }
+    }
 
     for (i = 0; i < b_info->num_vnuma_nodes; i++) {
         libxl_vnode_info *p = &b_info->vnuma_nodes[i];
@@ -1165,12 +1170,14 @@ static void parse_vnuma_config(const XLU_Config *config,
                     split_string_into_string_list(value, ",", &cpu_spec_list);
                     len = libxl_string_list_length(&cpu_spec_list);
 
-                    for (j = 0; j < len; j++)
+                    for (j = 0; j < len; j++) {
                         parse_range(cpu_spec_list[j], &s, &e);
+                        for (; s <= e; s++) {
+                            libxl_bitmap_set(&vcpu_parsed[i], s);
+                            max_vcpus++;
+                        }
+                    }
 
-                    vcpu_range_parsed[i].start = s;
-                    vcpu_range_parsed[i].end   = e;
-                    max_vcpus += (e - s + 1);
                     libxl_string_list_dispose(&cpu_spec_list);
                 } else if (!strcmp("vdistances", option)) {
                     libxl_string_list vdist;
@@ -1209,17 +1216,12 @@ static void parse_vnuma_config(const XLU_Config *config,
 
     for (i = 0; i < b_info->num_vnuma_nodes; i++) {
         libxl_vnode_info *p = &b_info->vnuma_nodes[i];
-        int cpu;
 
-        libxl_cpu_bitmap_alloc(ctx, &p->vcpus, b_info->max_vcpus);
-        libxl_bitmap_set_none(&p->vcpus);
-        for (cpu = vcpu_range_parsed[i].start;
-             cpu <= vcpu_range_parsed[i].end;
-             cpu++)
-            libxl_bitmap_set(&p->vcpus, cpu);
+        libxl_bitmap_copy_alloc(ctx, &p->vcpus, &vcpu_parsed[i]);
+        libxl_bitmap_dispose(&vcpu_parsed[i]);
     }
 
-    free(vcpu_range_parsed);
+    free(vcpu_parsed);
 }
 
 static void parse_config_data(const char *config_source,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:33:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARF-0004nP-3w; Fri, 31 Jul 2015 13:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARD-0004n9-UK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:28 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	B3/46-25435-7297BB55; Fri, 31 Jul 2015 13:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438349605!25486519!1
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 16232 invoked from network); 31 Jul 2015 13:33:26 -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;
	31 Jul 2015 13:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARB-0004NB-90
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARB-0006dM-7a
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:25 +0000
Date: Fri, 31 Jul 2015 13:33:25 +0000
Message-Id: <E1ZLARB-0006dM-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix vcpus to vnode assignement in
	config 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 a08b914807b14a8328d005079d774e7f8efd1d24
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Jul 21 19:31:57 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 22 15:16:56 2015 +0100

    xl: fix vcpus to vnode assignement in config file
    
    In fact, right now, the following (legitimate)
    configuration:
    
     vcpus       = '4'
     vnuma = [ [ "pnode=0","size=512","vcpus=0,1","vdistances=10,20"  ],
               [ "pnode=1","size=512","vcpus=2,3","vdistances=20,10"  ] ]
    
    Produces the following error:
    
     # xl create /etc/xen/test.cfg
     Parsing config from /etc/xen/test.cfg
     xl: maxvcpus < vcpu
    
    That is because, we only process the first element of the
    "vcpus=" list (of each vnode specification). Therefore,
    in the above case, we only see 2 vcpus, out of 4, being
    assigned to the vnodes, and hence the error.
    
    What we need is either a multidimentional array, or a
    bitmap, to temporary store the vcpus of a vnode, while
    parsing the vnuma config entry. Let's use the latter,
    which happens to also make it easier to copy the outcome
    of the parsing to its final destination in b_info, if
    everything goes ok.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5c6d1b0..1d45dd5 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1076,9 +1076,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     /* Temporary storage for parsed vcpus information to avoid
      * parsing config twice. This array has num_vnuma elements.
      */
-    struct vcpu_range_parsed {
-        unsigned long start, end;
-    } *vcpu_range_parsed;
+    libxl_bitmap *vcpu_parsed;
 
     libxl_physinfo_init(&physinfo);
     if (libxl_get_physinfo(ctx, &physinfo) != 0) {
@@ -1095,7 +1093,14 @@ static void parse_vnuma_config(const XLU_Config *config,
 
     b_info->num_vnuma_nodes = num_vnuma;
     b_info->vnuma_nodes = xcalloc(num_vnuma, sizeof(libxl_vnode_info));
-    vcpu_range_parsed = xcalloc(num_vnuma, sizeof(*vcpu_range_parsed));
+    vcpu_parsed = xcalloc(num_vnuma, sizeof(libxl_bitmap));
+    for (i = 0; i < num_vnuma; i++) {
+        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);
+        }
+    }
 
     for (i = 0; i < b_info->num_vnuma_nodes; i++) {
         libxl_vnode_info *p = &b_info->vnuma_nodes[i];
@@ -1165,12 +1170,14 @@ static void parse_vnuma_config(const XLU_Config *config,
                     split_string_into_string_list(value, ",", &cpu_spec_list);
                     len = libxl_string_list_length(&cpu_spec_list);
 
-                    for (j = 0; j < len; j++)
+                    for (j = 0; j < len; j++) {
                         parse_range(cpu_spec_list[j], &s, &e);
+                        for (; s <= e; s++) {
+                            libxl_bitmap_set(&vcpu_parsed[i], s);
+                            max_vcpus++;
+                        }
+                    }
 
-                    vcpu_range_parsed[i].start = s;
-                    vcpu_range_parsed[i].end   = e;
-                    max_vcpus += (e - s + 1);
                     libxl_string_list_dispose(&cpu_spec_list);
                 } else if (!strcmp("vdistances", option)) {
                     libxl_string_list vdist;
@@ -1209,17 +1216,12 @@ static void parse_vnuma_config(const XLU_Config *config,
 
     for (i = 0; i < b_info->num_vnuma_nodes; i++) {
         libxl_vnode_info *p = &b_info->vnuma_nodes[i];
-        int cpu;
 
-        libxl_cpu_bitmap_alloc(ctx, &p->vcpus, b_info->max_vcpus);
-        libxl_bitmap_set_none(&p->vcpus);
-        for (cpu = vcpu_range_parsed[i].start;
-             cpu <= vcpu_range_parsed[i].end;
-             cpu++)
-            libxl_bitmap_set(&p->vcpus, cpu);
+        libxl_bitmap_copy_alloc(ctx, &p->vcpus, &vcpu_parsed[i]);
+        libxl_bitmap_dispose(&vcpu_parsed[i]);
     }
 
-    free(vcpu_range_parsed);
+    free(vcpu_parsed);
 }
 
 static void parse_config_data(const char *config_source,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33: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 1ZLARQ-0004pK-6o; Fri, 31 Jul 2015 13:33: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 1ZLARP-0004p4-3N
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:39 +0000
Content-Length: 4206
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	60/27-02324-2397BB55; Fri, 31 Jul 2015 13:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1438349616!20862829!1
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 15834 invoked from network); 31 Jul 2015 13:33:37 -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;
	31 Jul 2015 13:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARM-0004NP-Ie
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARL-0006em-MX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:35 +0000
Date: Fri, 31 Jul 2015 13:33:35 +0000
Message-Id: <E1ZLARL-0006em-MX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/libxl: replace non-POSIX error
	codes used by PSR 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: multipart/mixed; boundary="===============0274367193662776819=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0274367193662776819==
Content-Length: 3860
Content-Transfer-Encoding: quoted-printable

commit 21a85ed569e59c5968b770a913a83a6b45213be7
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:45:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:45:35 2015 +0200

    x86/libxl: replace non-POSIX error codes used by PSR code
    
    PSR was using EBADSLT and EUSERS which are not POSIX error codes, replace
    them with ENOTSOCK and EOVERFLOW respectively.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_psr.c    |    6 +++---
 xen/arch/x86/psr.c         |    8 ++++----
 xen/include/public/errno.h |    1 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 2a07777..3378239 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -31,7 +31,7 @@ static void libxl__psr_log_err_msg(libxl__gc *gc, int err)
     case ESRCH:
         msg =3D "invalid domain ID";
         break;
-    case EBADSLT:
+    case ENOTSOCK:
         msg =3D "socket is not supported";
         break;
     case EFAULT:
@@ -59,7 +59,7 @@ static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg =3D "CMT is not attached to this domain";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg =3D "no free RMID available";
         break;
     default:
@@ -81,7 +81,7 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg =3D "CAT is not enabled on the socket";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg =3D "no free COS available";
         break;
     case EEXIST:
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index ed59803..c0daa2e 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -178,7 +178,7 @@ int psr_alloc_rmid(struct domain *d)
     if ( rmid > psr_cmt->rmid_max )
     {
         d->arch.psr_rmid =3D 0;
-        return -EUSERS;
+        return -EOVERFLOW;
     }
 
     d->arch.psr_rmid =3D rmid;
@@ -253,7 +253,7 @@ static struct psr_cat_socket_info *get_cat_socket_info(unsigned int socket)
         return ERR_PTR(-ENODEV);
 
     if ( socket >=3D nr_sockets )
-        return ERR_PTR(-EBADSLT);
+        return ERR_PTR(-ENOTSOCK);
 
     if ( !test_bit(socket, cat_socket_enable) )
         return ERR_PTR(-ENOENT);
@@ -334,7 +334,7 @@ static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
         unsigned int cpu =3D get_socket_cpu(socket);
 
         if ( cpu >=3D nr_cpu_ids )
-            return -EBADSLT;
+            return -ENOTSOCK;
         on_selected_cpus(cpumask_of(cpu), do_write_l3_cbm, &info, 1);
     }
 
@@ -383,7 +383,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
     if ( !found )
     {
         spin_unlock(&info->cbm_lock);
-        return -EUSERS;
+        return -EOVERFLOW;
     }
 
     cos =3D found - map;
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 9a7e411..50adcb9 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -65,6 +65,7 @@ XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
 XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
 #endif
 XEN_ERRNO(EUSERS,	87)	/* Too many users */
+XEN_ERRNO(ENOTSOCK,	88)	/* Socket operation on non-socket */
 XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
 XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
 XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33: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 1ZLARQ-0004pK-6o; Fri, 31 Jul 2015 13:33: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 1ZLARP-0004p4-3N
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:39 +0000
Content-Length: 4206
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	60/27-02324-2397BB55; Fri, 31 Jul 2015 13:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1438349616!20862829!1
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 15834 invoked from network); 31 Jul 2015 13:33:37 -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;
	31 Jul 2015 13:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARM-0004NP-Ie
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARL-0006em-MX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:35 +0000
Date: Fri, 31 Jul 2015 13:33:35 +0000
Message-Id: <E1ZLARL-0006em-MX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/libxl: replace non-POSIX error
	codes used by PSR 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: multipart/mixed; boundary="===============0274367193662776819=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0274367193662776819==
Content-Length: 3860
Content-Transfer-Encoding: quoted-printable

commit 21a85ed569e59c5968b770a913a83a6b45213be7
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:45:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:45:35 2015 +0200

    x86/libxl: replace non-POSIX error codes used by PSR code
    
    PSR was using EBADSLT and EUSERS which are not POSIX error codes, replace
    them with ENOTSOCK and EOVERFLOW respectively.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_psr.c    |    6 +++---
 xen/arch/x86/psr.c         |    8 ++++----
 xen/include/public/errno.h |    1 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 2a07777..3378239 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -31,7 +31,7 @@ static void libxl__psr_log_err_msg(libxl__gc *gc, int err)
     case ESRCH:
         msg =3D "invalid domain ID";
         break;
-    case EBADSLT:
+    case ENOTSOCK:
         msg =3D "socket is not supported";
         break;
     case EFAULT:
@@ -59,7 +59,7 @@ static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg =3D "CMT is not attached to this domain";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg =3D "no free RMID available";
         break;
     default:
@@ -81,7 +81,7 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg =3D "CAT is not enabled on the socket";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg =3D "no free COS available";
         break;
     case EEXIST:
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index ed59803..c0daa2e 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -178,7 +178,7 @@ int psr_alloc_rmid(struct domain *d)
     if ( rmid > psr_cmt->rmid_max )
     {
         d->arch.psr_rmid =3D 0;
-        return -EUSERS;
+        return -EOVERFLOW;
     }
 
     d->arch.psr_rmid =3D rmid;
@@ -253,7 +253,7 @@ static struct psr_cat_socket_info *get_cat_socket_info(unsigned int socket)
         return ERR_PTR(-ENODEV);
 
     if ( socket >=3D nr_sockets )
-        return ERR_PTR(-EBADSLT);
+        return ERR_PTR(-ENOTSOCK);
 
     if ( !test_bit(socket, cat_socket_enable) )
         return ERR_PTR(-ENOENT);
@@ -334,7 +334,7 @@ static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
         unsigned int cpu =3D get_socket_cpu(socket);
 
         if ( cpu >=3D nr_cpu_ids )
-            return -EBADSLT;
+            return -ENOTSOCK;
         on_selected_cpus(cpumask_of(cpu), do_write_l3_cbm, &info, 1);
     }
 
@@ -383,7 +383,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
     if ( !found )
     {
         spin_unlock(&info->cbm_lock);
-        return -EUSERS;
+        return -EOVERFLOW;
     }
 
     cos =3D found - map;
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 9a7e411..50adcb9 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -65,6 +65,7 @@ XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
 XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
 #endif
 XEN_ERRNO(EUSERS,	87)	/* Too many users */
+XEN_ERRNO(ENOTSOCK,	88)	/* Socket operation on non-socket */
 XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
 XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
 XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:33:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARa-0004rc-9w; Fri, 31 Jul 2015 13:33: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 1ZLARZ-0004rF-6l
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:49 +0000
Content-Length: 3194
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	FC/53-09570-C397BB55; Fri, 31 Jul 2015 13:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349626!31144779!1
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 13585 invoked from network); 31 Jul 2015 13:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARW-0004Nm-NL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARW-0006fC-MD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:46 +0000
Date: Fri, 31 Jul 2015 13:33:46 +0000
Message-Id: <E1ZLARW-0006fC-MD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] replace non-POSIX 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: multipart/mixed; boundary="===============3767887761080670822=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3767887761080670822==
Content-Length: 2817
Content-Transfer-Encoding: quoted-printable

commit e919fb2ac32a27c262fee8a40c044008b3f8fd09
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:47:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:47:09 2015 +0200

    replace non-POSIX error codes
    
    Some DOMCTLs returned non-POSIX error codes, replace them with POSIX
    compilant values instead. EBADRQC and EBADSLT are replaced by EDOM, while
    EUSERS is replaced with EOVERFLOW.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    
    Replace two EDOM uses.
    
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/paging.c |    2 +-
 xen/common/domain.c      |    4 ++--
 xen/common/hvm/save.c    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 7089155..942d849 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -766,7 +766,7 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     if ( op.interface_version !=3D XEN_DOMCTL_INTERFACE_VERSION ||
          op.cmd !=3D XEN_DOMCTL_shadow_op )
-        return -EBADRQC;
+        return -EOPNOTSUPP;
 
     d =3D rcu_lock_domain_by_id(op.domain);
     if ( d =3D=3D NULL )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8efef5c..791166b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -900,7 +900,7 @@ int vcpu_pause_by_systemcontroller(struct vcpu *v)
         new =3D old + 1;
 
         if ( new > 255 )
-            return -EUSERS;
+            return -EOVERFLOW;
 
         prev =3D cmpxchg(&v->controller_pause_count, old, new);
     } while ( prev !=3D old );
@@ -980,7 +980,7 @@ int __domain_pause_by_systemcontroller(struct domain *d,
          * toolstack overflowing d->pause_count with many repeated hypercalls.
          */
         if ( new > 255 )
-            return -EUSERS;
+            return -EOVERFLOW;
 
         prev =3D cmpxchg(&d->controller_pause_count, old, new);
     } while ( prev !=3D old );
diff --git a/xen/common/hvm/save.c b/xen/common/hvm/save.c
index da6e668..c9882e5 100644
--- a/xen/common/hvm/save.c
+++ b/xen/common/hvm/save.c
@@ -114,7 +114,7 @@ int hvm_save_one(struct domain *d, uint16_t typecode, uint16_t instance,
         uint32_t off;
         const struct hvm_save_descriptor *desc;
 
-        rv =3D -EBADSLT;
+        rv =3D -ENOENT;
         for ( off =3D 0; off < (ctxt.cur - sizeof(*desc)); off +=3D desc->length )
         {
             desc =3D (void *)(ctxt.data + off);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:33:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLARa-0004rc-9w; Fri, 31 Jul 2015 13:33: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 1ZLARZ-0004rF-6l
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:49 +0000
Content-Length: 3194
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	FC/53-09570-C397BB55; Fri, 31 Jul 2015 13:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349626!31144779!1
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 13585 invoked from network); 31 Jul 2015 13:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARW-0004Nm-NL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARW-0006fC-MD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:46 +0000
Date: Fri, 31 Jul 2015 13:33:46 +0000
Message-Id: <E1ZLARW-0006fC-MD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] replace non-POSIX 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: multipart/mixed; boundary="===============3767887761080670822=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3767887761080670822==
Content-Length: 2817
Content-Transfer-Encoding: quoted-printable

commit e919fb2ac32a27c262fee8a40c044008b3f8fd09
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:47:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:47:09 2015 +0200

    replace non-POSIX error codes
    
    Some DOMCTLs returned non-POSIX error codes, replace them with POSIX
    compilant values instead. EBADRQC and EBADSLT are replaced by EDOM, while
    EUSERS is replaced with EOVERFLOW.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    
    Replace two EDOM uses.
    
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/paging.c |    2 +-
 xen/common/domain.c      |    4 ++--
 xen/common/hvm/save.c    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 7089155..942d849 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -766,7 +766,7 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     if ( op.interface_version !=3D XEN_DOMCTL_INTERFACE_VERSION ||
          op.cmd !=3D XEN_DOMCTL_shadow_op )
-        return -EBADRQC;
+        return -EOPNOTSUPP;
 
     d =3D rcu_lock_domain_by_id(op.domain);
     if ( d =3D=3D NULL )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8efef5c..791166b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -900,7 +900,7 @@ int vcpu_pause_by_systemcontroller(struct vcpu *v)
         new =3D old + 1;
 
         if ( new > 255 )
-            return -EUSERS;
+            return -EOVERFLOW;
 
         prev =3D cmpxchg(&v->controller_pause_count, old, new);
     } while ( prev !=3D old );
@@ -980,7 +980,7 @@ int __domain_pause_by_systemcontroller(struct domain *d,
          * toolstack overflowing d->pause_count with many repeated hypercalls.
          */
         if ( new > 255 )
-            return -EUSERS;
+            return -EOVERFLOW;
 
         prev =3D cmpxchg(&d->controller_pause_count, old, new);
     } while ( prev !=3D old );
diff --git a/xen/common/hvm/save.c b/xen/common/hvm/save.c
index da6e668..c9882e5 100644
--- a/xen/common/hvm/save.c
+++ b/xen/common/hvm/save.c
@@ -114,7 +114,7 @@ int hvm_save_one(struct domain *d, uint16_t typecode, uint16_t instance,
         uint32_t off;
         const struct hvm_save_descriptor *desc;
 
-        rv =3D -EBADSLT;
+        rv =3D -ENOENT;
         for ( off =3D 0; off < (ctxt.cur - sizeof(*desc)); off +=3D desc->length )
         {
             desc =3D (void *)(ctxt.data + off);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLARk-0004tJ-Ca; Fri, 31 Jul 2015 13:34:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARj-0004t8-Mx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:59 +0000
Content-Length: 3526
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	0B/7B-12889-7497BB55; Fri, 31 Jul 2015 13:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349637!30796240!1
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 30527 invoked from network); 31 Jul 2015 13:33: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;
	31 Jul 2015 13:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARg-0004Nu-S1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARg-0006fi-R1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:56 +0000
Date: Fri, 31 Jul 2015 13:33:56 +0000
Message-Id: <E1ZLARg-0006fi-R1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove non-POSIX 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: multipart/mixed; boundary="===============0779609980790073702=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0779609980790073702==
Content-Length: 3142
Content-Transfer-Encoding: quoted-printable

commit afba7c6d9566f1556117b78e767f9678433a1f01
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:53:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:53:22 2015 +0200

    remove non-POSIX error codes
    
    Xen was using some non-POSIX error codes that are removed in this patch. For
    future reference, the list of POSIX error codes has been obtained from:
    
    http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
    
    The error codes already present and defined as optional (XSR), have been
    left in place.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/errno.h |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 50adcb9..8c88bb1 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -21,6 +21,12 @@ enum xen_errno {
 /*
  * Values originating from x86 Linux. Please consider using respective
  * values when adding new definitions here.
+ *
+ * The set of identifiers to be added here shouldn't extend beyond what
+ * POSIX mandates (see e.g.
+ * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html)
+ * with the exception that we support some optional (XSR) values
+ * specified there (but no new ones should be added).
  */
 
 XEN_ERRNO(EPERM,	 1)	/* Operation not permitted */
@@ -54,8 +60,6 @@ XEN_ERRNO(EDEADLK,	35)	/* Resource deadlock would occur */
 XEN_ERRNO(ENAMETOOLONG,	36)	/* File name too long */
 XEN_ERRNO(ENOLCK,	37)	/* No record locks available */
 XEN_ERRNO(ENOSYS,	38)	/* Function not implemented */
-XEN_ERRNO(EBADRQC,	56)	/* Invalid request code */
-XEN_ERRNO(EBADSLT,	57)	/* Invalid slot */
 XEN_ERRNO(ENODATA,	61)	/* No data available */
 XEN_ERRNO(ETIME,	62)	/* Timer expired */
 XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
@@ -64,7 +68,6 @@ XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
 #ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
 XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
 #endif
-XEN_ERRNO(EUSERS,	87)	/* Too many users */
 XEN_ERRNO(ENOTSOCK,	88)	/* Socket operation on non-socket */
 XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
 XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
@@ -72,8 +75,6 @@ XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
 XEN_ERRNO(ENOBUFS,	105)	/* No buffer space available */
 XEN_ERRNO(EISCONN,	106)	/* Transport endpoint is already connected */
 XEN_ERRNO(ENOTCONN,	107)	/* Transport endpoint is not connected */
-XEN_ERRNO(ESHUTDOWN,	108)	/* Cannot send after transport endpoint shutdown */
-XEN_ERRNO(ETOOMANYREFS,	109)	/* Too many references: cannot splice */
 XEN_ERRNO(ETIMEDOUT,	110)	/* Connection timed out */
 
 #undef XEN_ERRNO
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLARk-0004tJ-Ca; Fri, 31 Jul 2015 13:34:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARj-0004t8-Mx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:59 +0000
Content-Length: 3526
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	0B/7B-12889-7497BB55; Fri, 31 Jul 2015 13:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349637!30796240!1
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 30527 invoked from network); 31 Jul 2015 13:33: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;
	31 Jul 2015 13:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARg-0004Nu-S1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARg-0006fi-R1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:33:56 +0000
Date: Fri, 31 Jul 2015 13:33:56 +0000
Message-Id: <E1ZLARg-0006fi-R1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove non-POSIX 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: multipart/mixed; boundary="===============0779609980790073702=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0779609980790073702==
Content-Length: 3142
Content-Transfer-Encoding: quoted-printable

commit afba7c6d9566f1556117b78e767f9678433a1f01
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jul 22 16:53:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 22 16:53:22 2015 +0200

    remove non-POSIX error codes
    
    Xen was using some non-POSIX error codes that are removed in this patch. For
    future reference, the list of POSIX error codes has been obtained from:
    
    http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
    
    The error codes already present and defined as optional (XSR), have been
    left in place.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/errno.h |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 50adcb9..8c88bb1 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -21,6 +21,12 @@ enum xen_errno {
 /*
  * Values originating from x86 Linux. Please consider using respective
  * values when adding new definitions here.
+ *
+ * The set of identifiers to be added here shouldn't extend beyond what
+ * POSIX mandates (see e.g.
+ * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html)
+ * with the exception that we support some optional (XSR) values
+ * specified there (but no new ones should be added).
  */
 
 XEN_ERRNO(EPERM,	 1)	/* Operation not permitted */
@@ -54,8 +60,6 @@ XEN_ERRNO(EDEADLK,	35)	/* Resource deadlock would occur */
 XEN_ERRNO(ENAMETOOLONG,	36)	/* File name too long */
 XEN_ERRNO(ENOLCK,	37)	/* No record locks available */
 XEN_ERRNO(ENOSYS,	38)	/* Function not implemented */
-XEN_ERRNO(EBADRQC,	56)	/* Invalid request code */
-XEN_ERRNO(EBADSLT,	57)	/* Invalid slot */
 XEN_ERRNO(ENODATA,	61)	/* No data available */
 XEN_ERRNO(ETIME,	62)	/* Timer expired */
 XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
@@ -64,7 +68,6 @@ XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
 #ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
 XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
 #endif
-XEN_ERRNO(EUSERS,	87)	/* Too many users */
 XEN_ERRNO(ENOTSOCK,	88)	/* Socket operation on non-socket */
 XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
 XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
@@ -72,8 +75,6 @@ XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
 XEN_ERRNO(ENOBUFS,	105)	/* No buffer space available */
 XEN_ERRNO(EISCONN,	106)	/* Transport endpoint is already connected */
 XEN_ERRNO(ENOTCONN,	107)	/* Transport endpoint is not connected */
-XEN_ERRNO(ESHUTDOWN,	108)	/* Cannot send after transport endpoint shutdown */
-XEN_ERRNO(ETOOMANYREFS,	109)	/* Too many references: cannot splice */
 XEN_ERRNO(ETIMEDOUT,	110)	/* Connection timed out */
 
 #undef XEN_ERRNO
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLARu-0004vL-IP; Fri, 31 Jul 2015 13:34: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 1ZLARt-0004v4-GV
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C6/15-29649-0597BB55; Fri, 31 Jul 2015 13:34:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349647!26709724!1
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 19243 invoked from network); 31 Jul 2015 13:34:08 -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;
	31 Jul 2015 13:34:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARr-0004OU-1C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARr-0006gi-0C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:07 +0000
Date: Fri, 31 Jul 2015 13:34:07 +0000
Message-Id: <E1ZLARr-0006gi-0C@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 ce6ce4a8a88fa7930838fc9fa06300bc43713671
Merge: a08b914807b14a8328d005079d774e7f8efd1d24 afba7c6d9566f1556117b78e767f9678433a1f01
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 22 15:55:14 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 22 15:55:14 2015 +0100

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

 tools/libxl/libxl_psr.c    |    6 +++---
 xen/arch/x86/mm/paging.c   |    2 +-
 xen/arch/x86/psr.c         |    8 ++++----
 xen/common/domain.c        |    4 ++--
 xen/common/hvm/save.c      |    2 +-
 xen/include/public/errno.h |   12 +++++++-----
 6 files changed, 18 insertions(+), 16 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 Jul 31 13:34:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLARu-0004vL-IP; Fri, 31 Jul 2015 13:34: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 1ZLARt-0004v4-GV
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C6/15-29649-0597BB55; Fri, 31 Jul 2015 13:34:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349647!26709724!1
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 19243 invoked from network); 31 Jul 2015 13:34:08 -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;
	31 Jul 2015 13:34:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARr-0004OU-1C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLARr-0006gi-0C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:07 +0000
Date: Fri, 31 Jul 2015 13:34:07 +0000
Message-Id: <E1ZLARr-0006gi-0C@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 ce6ce4a8a88fa7930838fc9fa06300bc43713671
Merge: a08b914807b14a8328d005079d774e7f8efd1d24 afba7c6d9566f1556117b78e767f9678433a1f01
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 22 15:55:14 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 22 15:55:14 2015 +0100

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

 tools/libxl/libxl_psr.c    |    6 +++---
 xen/arch/x86/mm/paging.c   |    2 +-
 xen/arch/x86/psr.c         |    8 ++++----
 xen/common/domain.c        |    4 ++--
 xen/common/hvm/save.c      |    2 +-
 xen/include/public/errno.h |   12 +++++++-----
 6 files changed, 18 insertions(+), 16 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 Jul 31 13:34:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLAS5-0004wy-L0; Fri, 31 Jul 2015 13:34:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS3-0004wg-WD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:20 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AB/30-19125-B597BB55; Fri, 31 Jul 2015 13:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438349657!24964727!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 18292 invoked from network); 31 Jul 2015 13:34:18 -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;
	31 Jul 2015 13:34:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS1-0004Oc-6d
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS1-0006hK-5P
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:17 +0000
Date: Fri, 31 Jul 2015 13:34:17 +0000
Message-Id: <E1ZLAS1-0006hK-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PCI: add config space abstract
	write intercept logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a88b72fddd046a0978242411276861039ec99ad0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:13:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:13:12 2015 +0200

    x86/PCI: add config space abstract write intercept logic
    
    This is to be used by MSI code, and later to also be hooked up to
    MMCFG accesses by Dom0.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c        |    6 ++++++
 xen/arch/x86/pci.c        |   25 +++++++++++++++++++++++++
 xen/arch/x86/traps.c      |   16 ++++++++++------
 xen/include/asm-x86/pci.h |    6 ++++++
 4 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d930f8f..b9333b8 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1108,6 +1108,12 @@ void pci_cleanup_msi(struct pci_dev *pdev)
     msi_free_irqs(pdev);
 }
 
+int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
+                                 unsigned int size, uint32_t *data)
+{
+    return 0;
+}
+
 int pci_restore_msi_state(struct pci_dev *pdev)
 {
     unsigned long flags;
diff --git a/xen/arch/x86/pci.c b/xen/arch/x86/pci.c
index 88e926d..5bcecbb 100644
--- a/xen/arch/x86/pci.c
+++ b/xen/arch/x86/pci.c
@@ -67,3 +67,28 @@ void pci_conf_write(uint32_t cf8, uint8_t offset, uint8_t bytes, uint32_t data)
 
     spin_unlock_irqrestore(&pci_config_lock, flags);
 }
+
+int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
+                             unsigned int reg, unsigned int size,
+                             uint32_t *data)
+{
+    struct pci_dev *pdev;
+    int rc = 0;
+
+    /*
+     * Avoid expensive operations when no hook is going to do anything
+     * for the access anyway.
+     */
+    if ( reg < 64 || reg >= 256 )
+        return 0;
+
+    spin_lock(&pcidevs_lock);
+
+    pdev = pci_get_pdev(seg, PCI_BUS(bdf), PCI_DEVFN2(bdf));
+    if ( pdev )
+        rc = pci_msi_conf_write_intercept(pdev, reg, size, data);
+
+    spin_unlock(&pcidevs_lock);
+
+    return rc;
+}
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6a03582..58ba4ea 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1777,8 +1777,8 @@ static bool_t admin_io_okay(unsigned int port, unsigned int bytes,
     return ioports_access_permitted(d, port, port + bytes - 1);
 }
 
-static bool_t pci_cfg_ok(struct domain *currd, bool_t write,
-                         unsigned int start, unsigned int size)
+static bool_t pci_cfg_ok(struct domain *currd, unsigned int start,
+                         unsigned int size, uint32_t *write)
 {
     uint32_t machine_bdf;
 
@@ -1810,8 +1810,12 @@ static bool_t pci_cfg_ok(struct domain *currd, bool_t write,
             start |= CF8_ADDR_HI(currd->arch.pci_cf8);
     }
 
-    return !xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf,
-                                      start, start + size - 1, write);
+    if ( xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf,
+                                   start, start + size - 1, !!write) != 0 )
+         return 0;
+
+    return !write ||
+           pci_conf_write_intercept(0, machine_bdf, start, size, write) >= 0;
 }
 
 uint32_t guest_io_read(unsigned int port, unsigned int bytes,
@@ -1863,7 +1867,7 @@ uint32_t guest_io_read(unsigned int port, unsigned int bytes,
             size = min(bytes, 4 - (port & 3));
             if ( size == 3 )
                 size = 2;
-            if ( pci_cfg_ok(currd, 0, port & 3, size) )
+            if ( pci_cfg_ok(currd, port & 3, size, NULL) )
                 sub_data = pci_conf_read(currd->arch.pci_cf8, port & 3, size);
         }
 
@@ -1934,7 +1938,7 @@ void guest_io_write(unsigned int port, unsigned int bytes, uint32_t data,
             size = min(bytes, 4 - (port & 3));
             if ( size == 3 )
                 size = 2;
-            if ( pci_cfg_ok(currd, 1, port & 3, size) )
+            if ( pci_cfg_ok(currd, port & 3, size, &data) )
                 pci_conf_write(currd->arch.pci_cf8, port & 3, size, data);
         }
 
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index af63a57..da28a90 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -15,4 +15,10 @@ struct arch_pci_dev {
     vmask_t used_vectors;
 };
 
+int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
+                             unsigned int reg, unsigned int size,
+                             uint32_t *data);
+int pci_msi_conf_write_intercept(struct pci_dev *, unsigned int reg,
+                                 unsigned int size, uint32_t *data);
+
 #endif /* __X86_PCI_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 Fri Jul 31 13:34:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLAS5-0004wy-L0; Fri, 31 Jul 2015 13:34:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS3-0004wg-WD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:20 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AB/30-19125-B597BB55; Fri, 31 Jul 2015 13:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438349657!24964727!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 18292 invoked from network); 31 Jul 2015 13:34:18 -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;
	31 Jul 2015 13:34:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS1-0004Oc-6d
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAS1-0006hK-5P
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:17 +0000
Date: Fri, 31 Jul 2015 13:34:17 +0000
Message-Id: <E1ZLAS1-0006hK-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PCI: add config space abstract
	write intercept logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a88b72fddd046a0978242411276861039ec99ad0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:13:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:13:12 2015 +0200

    x86/PCI: add config space abstract write intercept logic
    
    This is to be used by MSI code, and later to also be hooked up to
    MMCFG accesses by Dom0.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c        |    6 ++++++
 xen/arch/x86/pci.c        |   25 +++++++++++++++++++++++++
 xen/arch/x86/traps.c      |   16 ++++++++++------
 xen/include/asm-x86/pci.h |    6 ++++++
 4 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d930f8f..b9333b8 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1108,6 +1108,12 @@ void pci_cleanup_msi(struct pci_dev *pdev)
     msi_free_irqs(pdev);
 }
 
+int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
+                                 unsigned int size, uint32_t *data)
+{
+    return 0;
+}
+
 int pci_restore_msi_state(struct pci_dev *pdev)
 {
     unsigned long flags;
diff --git a/xen/arch/x86/pci.c b/xen/arch/x86/pci.c
index 88e926d..5bcecbb 100644
--- a/xen/arch/x86/pci.c
+++ b/xen/arch/x86/pci.c
@@ -67,3 +67,28 @@ void pci_conf_write(uint32_t cf8, uint8_t offset, uint8_t bytes, uint32_t data)
 
     spin_unlock_irqrestore(&pci_config_lock, flags);
 }
+
+int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
+                             unsigned int reg, unsigned int size,
+                             uint32_t *data)
+{
+    struct pci_dev *pdev;
+    int rc = 0;
+
+    /*
+     * Avoid expensive operations when no hook is going to do anything
+     * for the access anyway.
+     */
+    if ( reg < 64 || reg >= 256 )
+        return 0;
+
+    spin_lock(&pcidevs_lock);
+
+    pdev = pci_get_pdev(seg, PCI_BUS(bdf), PCI_DEVFN2(bdf));
+    if ( pdev )
+        rc = pci_msi_conf_write_intercept(pdev, reg, size, data);
+
+    spin_unlock(&pcidevs_lock);
+
+    return rc;
+}
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6a03582..58ba4ea 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1777,8 +1777,8 @@ static bool_t admin_io_okay(unsigned int port, unsigned int bytes,
     return ioports_access_permitted(d, port, port + bytes - 1);
 }
 
-static bool_t pci_cfg_ok(struct domain *currd, bool_t write,
-                         unsigned int start, unsigned int size)
+static bool_t pci_cfg_ok(struct domain *currd, unsigned int start,
+                         unsigned int size, uint32_t *write)
 {
     uint32_t machine_bdf;
 
@@ -1810,8 +1810,12 @@ static bool_t pci_cfg_ok(struct domain *currd, bool_t write,
             start |= CF8_ADDR_HI(currd->arch.pci_cf8);
     }
 
-    return !xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf,
-                                      start, start + size - 1, write);
+    if ( xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf,
+                                   start, start + size - 1, !!write) != 0 )
+         return 0;
+
+    return !write ||
+           pci_conf_write_intercept(0, machine_bdf, start, size, write) >= 0;
 }
 
 uint32_t guest_io_read(unsigned int port, unsigned int bytes,
@@ -1863,7 +1867,7 @@ uint32_t guest_io_read(unsigned int port, unsigned int bytes,
             size = min(bytes, 4 - (port & 3));
             if ( size == 3 )
                 size = 2;
-            if ( pci_cfg_ok(currd, 0, port & 3, size) )
+            if ( pci_cfg_ok(currd, port & 3, size, NULL) )
                 sub_data = pci_conf_read(currd->arch.pci_cf8, port & 3, size);
         }
 
@@ -1934,7 +1938,7 @@ void guest_io_write(unsigned int port, unsigned int bytes, uint32_t data,
             size = min(bytes, 4 - (port & 3));
             if ( size == 3 )
                 size = 2;
-            if ( pci_cfg_ok(currd, 1, port & 3, size) )
+            if ( pci_cfg_ok(currd, port & 3, size, &data) )
                 pci_conf_write(currd->arch.pci_cf8, port & 3, size, data);
         }
 
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index af63a57..da28a90 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -15,4 +15,10 @@ struct arch_pci_dev {
     vmask_t used_vectors;
 };
 
+int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
+                             unsigned int reg, unsigned int size,
+                             uint32_t *data);
+int pci_msi_conf_write_intercept(struct pci_dev *, unsigned int reg,
+                                 unsigned int size, uint32_t *data);
+
 #endif /* __X86_PCI_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 Fri Jul 31 13:34:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLASE-0004y9-NU; Fri, 31 Jul 2015 13:34: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 1ZLASD-0004xy-Ot
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	86/9B-01753-5697BB55; Fri, 31 Jul 2015 13:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438349667!31094329!1
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 14767 invoked from network); 31 Jul 2015 13:34:28 -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;
	31 Jul 2015 13:34:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASB-0004Ok-Cj
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASB-0006i2-BB
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:27 +0000
Date: Fri, 31 Jul 2015 13:34:27 +0000
Message-Id: <E1ZLASB-0006i2-BB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: track host and guest
	mask-all requests separately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 484d7c852e4ff79c945406ed28b5db63a5a0b7f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:14:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:14:13 2015 +0200

    x86/MSI-X: track host and guest mask-all requests separately
    
    Host uses of the bits will be added subsequently, and must not be
    overridden by guests (including Dom0, namely when acting on behalf of
    a guest).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c        |   34 ++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/msi.h |    1 +
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index b9333b8..321b6aa 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -843,6 +843,12 @@ static int msix_capability_init(struct pci_dev *dev,
 
     if ( !msix->used_entries )
     {
+        msix->host_maskall = 0;
+        if ( !msix->guest_maskall )
+            control &= ~PCI_MSIX_FLAGS_MASKALL;
+        else
+            control |= PCI_MSIX_FLAGS_MASKALL;
+
         if ( rangeset_add_range(mmio_ro_ranges, msix->table.first,
                                 msix->table.last) )
             WARN();
@@ -1111,6 +1117,34 @@ void pci_cleanup_msi(struct pci_dev *pdev)
 int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
                                  unsigned int size, uint32_t *data)
 {
+    u16 seg = pdev->seg;
+    u8 bus = pdev->bus;
+    u8 slot = PCI_SLOT(pdev->devfn);
+    u8 func = PCI_FUNC(pdev->devfn);
+    struct msi_desc *entry;
+    unsigned int pos;
+
+    if ( pdev->msix )
+    {
+        entry = find_msi_entry(pdev, -1, PCI_CAP_ID_MSIX);
+        pos = entry ? entry->msi_attrib.pos
+                    : pci_find_cap_offset(seg, bus, slot, func,
+                                          PCI_CAP_ID_MSIX);
+        ASSERT(pos);
+
+        if ( reg < pos || reg >= msix_pba_offset_reg(pos) + 4 )
+            return 0;
+
+        if ( reg != msix_control_reg(pos) || size != 2 )
+            return -EACCES;
+
+        pdev->msix->guest_maskall = !!(*data & PCI_MSIX_FLAGS_MASKALL);
+        if ( pdev->msix->host_maskall )
+            *data |= PCI_MSIX_FLAGS_MASKALL;
+
+        return 1;
+    }
+
     return 0;
 }
 
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 8c7a93d..f83e748 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -233,6 +233,7 @@ struct arch_msix {
     int table_refcnt[MAX_MSIX_TABLE_PAGES];
     int table_idx[MAX_MSIX_TABLE_PAGES];
     spinlock_t table_lock;
+    bool_t host_maskall, guest_maskall;
     domid_t warned;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:34:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLASE-0004y9-NU; Fri, 31 Jul 2015 13:34: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 1ZLASD-0004xy-Ot
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	86/9B-01753-5697BB55; Fri, 31 Jul 2015 13:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438349667!31094329!1
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 14767 invoked from network); 31 Jul 2015 13:34:28 -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;
	31 Jul 2015 13:34:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASB-0004Ok-Cj
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASB-0006i2-BB
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:27 +0000
Date: Fri, 31 Jul 2015 13:34:27 +0000
Message-Id: <E1ZLASB-0006i2-BB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: track host and guest
	mask-all requests separately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 484d7c852e4ff79c945406ed28b5db63a5a0b7f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:14:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:14:13 2015 +0200

    x86/MSI-X: track host and guest mask-all requests separately
    
    Host uses of the bits will be added subsequently, and must not be
    overridden by guests (including Dom0, namely when acting on behalf of
    a guest).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c        |   34 ++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/msi.h |    1 +
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index b9333b8..321b6aa 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -843,6 +843,12 @@ static int msix_capability_init(struct pci_dev *dev,
 
     if ( !msix->used_entries )
     {
+        msix->host_maskall = 0;
+        if ( !msix->guest_maskall )
+            control &= ~PCI_MSIX_FLAGS_MASKALL;
+        else
+            control |= PCI_MSIX_FLAGS_MASKALL;
+
         if ( rangeset_add_range(mmio_ro_ranges, msix->table.first,
                                 msix->table.last) )
             WARN();
@@ -1111,6 +1117,34 @@ void pci_cleanup_msi(struct pci_dev *pdev)
 int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
                                  unsigned int size, uint32_t *data)
 {
+    u16 seg = pdev->seg;
+    u8 bus = pdev->bus;
+    u8 slot = PCI_SLOT(pdev->devfn);
+    u8 func = PCI_FUNC(pdev->devfn);
+    struct msi_desc *entry;
+    unsigned int pos;
+
+    if ( pdev->msix )
+    {
+        entry = find_msi_entry(pdev, -1, PCI_CAP_ID_MSIX);
+        pos = entry ? entry->msi_attrib.pos
+                    : pci_find_cap_offset(seg, bus, slot, func,
+                                          PCI_CAP_ID_MSIX);
+        ASSERT(pos);
+
+        if ( reg < pos || reg >= msix_pba_offset_reg(pos) + 4 )
+            return 0;
+
+        if ( reg != msix_control_reg(pos) || size != 2 )
+            return -EACCES;
+
+        pdev->msix->guest_maskall = !!(*data & PCI_MSIX_FLAGS_MASKALL);
+        if ( pdev->msix->host_maskall )
+            *data |= PCI_MSIX_FLAGS_MASKALL;
+
+        return 1;
+    }
+
     return 0;
 }
 
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 8c7a93d..f83e748 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -233,6 +233,7 @@ struct arch_msix {
     int table_refcnt[MAX_MSIX_TABLE_PAGES];
     int table_idx[MAX_MSIX_TABLE_PAGES];
     spinlock_t table_lock;
+    bool_t host_maskall, guest_maskall;
     domid_t warned;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:34:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLASP-0004zg-QF; Fri, 31 Jul 2015 13:34: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 1ZLASO-0004zX-Ng
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:40 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	FE/2C-01421-F697BB55; Fri, 31 Jul 2015 13:34:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349677!26709894!1
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 23493 invoked from network); 31 Jul 2015 13:34:38 -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;
	31 Jul 2015 13:34:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASL-0004Os-IX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASL-0006jA-Go
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:37 +0000
Date: Fri, 31 Jul 2015 13:34:37 +0000
Message-Id: <E1ZLASL-0006jA-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: be more careful during
	teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 082fdc6ce85e5b603f8fb24553cf200e3b67889f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:14:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:14:59 2015 +0200

    x86/MSI-X: be more careful during teardown
    
    When a device gets detached from a guest, pciback will clear its
    command register, thus disabling both memory and I/O decoding. The
    disabled memory decoding, however, has an effect on the MSI-X table
    accesses the hypervisor does: These won't have the intended effect
    anymore. Even worse, for PCIe devices (but not SR-IOV virtual
    functions) such accesses may (will?) be treated as Unsupported
    Requests, causing respective errors to be surfaced, potentially in the
    form of NMIs that may be fatal to the hypervisor or Dom0 is different
    ways. Hence rather than carrying out these accesses, we should avoid
    them where we can, and use alternative (e.g. PCI config space based)
    mechanisms to achieve at least the same effect.
    
    At this time it continues to be unclear whether this is fixing an
    actual bug or is rather just working around bogus (but apparently
    common) system behavior.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/irq.c |    6 +-
 xen/arch/x86/msi.c |  142 ++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 119 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 78e3f2e..62fb319 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -217,9 +217,9 @@ void destroy_irq(unsigned int irq)
     }
 
     spin_lock_irqsave(&desc->lock, flags);
-    desc->status  |= IRQ_DISABLED;
     desc->status  &= ~IRQ_GUEST;
     desc->handler->shutdown(desc);
+    desc->status |= IRQ_DISABLED;
     action = desc->action;
     desc->action  = NULL;
     desc->msi_desc = NULL;
@@ -995,8 +995,8 @@ void __init release_irq(unsigned int irq, const void *dev_id)
     spin_lock_irqsave(&desc->lock,flags);
     action = desc->action;
     desc->action  = NULL;
-    desc->status |= IRQ_DISABLED;
     desc->handler->shutdown(desc);
+    desc->status |= IRQ_DISABLED;
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
@@ -1732,8 +1732,8 @@ static irq_guest_action_t *__pirq_guest_unbind(
     BUG_ON(action->in_flight != 0);
 
     /* Disabling IRQ before releasing the desc_lock avoids an IRQ storm. */
-    desc->status |= IRQ_DISABLED;
     desc->handler->disable(desc);
+    desc->status |= IRQ_DISABLED;
 
     /*
      * Mark any remaining pending EOIs as ready to flush.
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 321b6aa..dfa9329 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -123,6 +123,27 @@ static void msix_put_fixmap(struct arch_msix *msix, int idx)
     spin_unlock(&msix->table_lock);
 }
 
+static bool_t memory_decoded(const struct pci_dev *dev)
+{
+    u8 bus, slot, func;
+
+    if ( !dev->info.is_virtfn )
+    {
+        bus = dev->bus;
+        slot = PCI_SLOT(dev->devfn);
+        func = PCI_FUNC(dev->devfn);
+    }
+    else
+    {
+        bus = dev->info.physfn.bus;
+        slot = PCI_SLOT(dev->info.physfn.devfn);
+        func = PCI_FUNC(dev->info.physfn.devfn);
+    }
+
+    return !!(pci_conf_read16(dev->seg, bus, slot, func, PCI_COMMAND) &
+              PCI_COMMAND_MEMORY);
+}
+
 /*
  * MSI message composition
  */
@@ -166,7 +187,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
     }
 }
 
-static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     switch ( entry->msi_attrib.type )
     {
@@ -201,6 +222,8 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            return 0;
         msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
         msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
@@ -212,6 +235,8 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 
     if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
+
+    return 1;
 }
 
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
@@ -262,6 +287,8 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            return -ENXIO;
         writel(msg->address_lo,
                base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         writel(msg->address_hi,
@@ -289,7 +316,8 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
     ASSERT(spin_is_locked(&desc->lock));
 
     memset(&msg, 0, sizeof(msg));
-    read_msi_msg(msi_desc, &msg);
+    if ( !read_msi_msg(msi_desc, &msg) )
+        return;
 
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
@@ -349,23 +377,27 @@ int msi_maskable_irq(const struct msi_desc *entry)
            || entry->msi_attrib.maskbit;
 }
 
-static void msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
+static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
 {
     struct msi_desc *entry = desc->msi_desc;
+    struct pci_dev *pdev;
+    u16 seg;
+    u8 bus, slot, func;
     bool_t flag = host || guest;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
+    pdev = entry->dev;
+    seg = pdev->seg;
+    bus = pdev->bus;
+    slot = PCI_SLOT(pdev->devfn);
+    func = PCI_FUNC(pdev->devfn);
     switch ( entry->msi_attrib.type )
     {
     case PCI_CAP_ID_MSI:
         if ( entry->msi_attrib.maskbit )
         {
             u32 mask_bits;
-            u16 seg = entry->dev->seg;
-            u8 bus = entry->dev->bus;
-            u8 slot = PCI_SLOT(entry->dev->devfn);
-            u8 func = PCI_FUNC(entry->dev->devfn);
 
             mask_bits = pci_conf_read32(seg, bus, slot, func, entry->msi.mpos);
             mask_bits &= ~((u32)1 << entry->msi_attrib.entry_nr);
@@ -374,25 +406,54 @@ static void msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
         }
         break;
     case PCI_CAP_ID_MSIX:
-    {
-        int offset = PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET;
-        writel(flag, entry->mask_base + offset);
-        readl(entry->mask_base + offset);
-        break;
-    }
+        if ( likely(memory_decoded(pdev)) )
+        {
+            writel(flag, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+            readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+            break;
+        }
+        if ( flag )
+        {
+            u16 control;
+            domid_t domid = pdev->domain->domain_id;
+
+            pdev->msix->host_maskall = 1;
+            control = pci_conf_read16(seg, bus, slot, func,
+                                      msix_control_reg(entry->msi_attrib.pos));
+            if ( control & PCI_MSIX_FLAGS_MASKALL )
+                break;
+            pci_conf_write16(seg, bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | PCI_MSIX_FLAGS_MASKALL);
+            if ( pdev->msix->warned != domid )
+            {
+                pdev->msix->warned = domid;
+                printk(XENLOG_G_WARNING
+                       "cannot mask IRQ %d: masked MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
+                       desc->irq, domid, pdev->seg, pdev->bus,
+                       PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
+            }
+            break;
+        }
+        /* fall through */
     default:
-        BUG();
-        break;
+        return 0;
     }
     entry->msi_attrib.host_masked = host;
     entry->msi_attrib.guest_masked = guest;
+
+    return 1;
 }
 
 static int msi_get_mask_bit(const struct msi_desc *entry)
 {
-    switch (entry->msi_attrib.type) {
+    if ( !entry->dev )
+        return -1;
+
+    switch ( entry->msi_attrib.type )
+    {
     case PCI_CAP_ID_MSI:
-        if (!entry->dev || !entry->msi_attrib.maskbit)
+        if ( !entry->msi_attrib.maskbit )
             break;
         return (pci_conf_read32(entry->dev->seg, entry->dev->bus,
                                 PCI_SLOT(entry->dev->devfn),
@@ -400,6 +461,8 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
                                 entry->msi.mpos) >>
                 entry->msi_attrib.entry_nr) & 1;
     case PCI_CAP_ID_MSIX:
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            break;
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
     return -1;
@@ -407,12 +470,16 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
 
 void mask_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 1, desc->msi_desc->msi_attrib.guest_masked);
+    if ( unlikely(!msi_set_mask_bit(desc, 1,
+                                    desc->msi_desc->msi_attrib.guest_masked)) )
+        BUG_ON(!(desc->status & IRQ_DISABLED));
 }
 
 void unmask_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 0, desc->msi_desc->msi_attrib.guest_masked);
+    if ( unlikely(!msi_set_mask_bit(desc, 0,
+                                    desc->msi_desc->msi_attrib.guest_masked)) )
+        WARN();
 }
 
 void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
@@ -422,13 +489,15 @@ void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
 
 static unsigned int startup_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 0, !!(desc->status & IRQ_GUEST));
+    if ( unlikely(!msi_set_mask_bit(desc, 0, !!(desc->status & IRQ_GUEST))) )
+        WARN();
     return 0;
 }
 
 static void shutdown_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 1, 1);
+    if ( unlikely(!msi_set_mask_bit(desc, 1, 1)) )
+        BUG_ON(!(desc->status & IRQ_DISABLED));
 }
 
 void ack_nonmaskable_msi_irq(struct irq_desc *desc)
@@ -740,6 +809,9 @@ static int msix_capability_init(struct pci_dev *dev,
     control = pci_conf_read16(seg, bus, slot, func, msix_control_reg(pos));
     msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
 
+    if ( unlikely(!memory_decoded(dev)) )
+        return -ENXIO;
+
     if ( desc )
     {
         entry = alloc_msi_entry(1);
@@ -879,7 +951,8 @@ static int msix_capability_init(struct pci_dev *dev,
     ++msix->used_entries;
 
     /* Restore MSI-X enabled bits */
-    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                     control & ~PCI_MSIX_FLAGS_MASKALL);
 
     return 0;
 }
@@ -1024,8 +1097,16 @@ static void __pci_disable_msix(struct msi_desc *entry)
 
     BUG_ON(list_empty(&dev->msi_list));
 
-    writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-
+    if ( likely(memory_decoded(dev)) )
+        writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+    else if ( !(control & PCI_MSIX_FLAGS_MASKALL) )
+    {
+        printk(XENLOG_WARNING
+               "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
+               entry->irq, dev->seg, dev->bus,
+               PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+        control |= PCI_MSIX_FLAGS_MASKALL;
+    }
     pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     _pci_cleanup_msix(dev->msix);
@@ -1199,15 +1280,24 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             nr = entry->msi.nvec;
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        {
             msix_set_enable(pdev, 0);
+            if ( unlikely(!memory_decoded(pdev)) )
+            {
+                spin_unlock_irqrestore(&desc->lock, flags);
+                return -ENXIO;
+            }
+        }
 
         msg = entry->msg;
         write_msi_msg(entry, &msg);
 
         for ( i = 0; ; )
         {
-            msi_set_mask_bit(desc, entry[i].msi_attrib.host_masked,
-                             entry[i].msi_attrib.guest_masked);
+            if ( unlikely(!msi_set_mask_bit(desc,
+                                            entry[i].msi_attrib.host_masked,
+                                            entry[i].msi_attrib.guest_masked)) )
+                BUG();
 
             if ( !--nr )
                 break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLASP-0004zg-QF; Fri, 31 Jul 2015 13:34: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 1ZLASO-0004zX-Ng
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:40 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	FE/2C-01421-F697BB55; Fri, 31 Jul 2015 13:34:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349677!26709894!1
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 23493 invoked from network); 31 Jul 2015 13:34:38 -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;
	31 Jul 2015 13:34:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASL-0004Os-IX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASL-0006jA-Go
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:37 +0000
Date: Fri, 31 Jul 2015 13:34:37 +0000
Message-Id: <E1ZLASL-0006jA-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: be more careful during
	teardown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 082fdc6ce85e5b603f8fb24553cf200e3b67889f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:14:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:14:59 2015 +0200

    x86/MSI-X: be more careful during teardown
    
    When a device gets detached from a guest, pciback will clear its
    command register, thus disabling both memory and I/O decoding. The
    disabled memory decoding, however, has an effect on the MSI-X table
    accesses the hypervisor does: These won't have the intended effect
    anymore. Even worse, for PCIe devices (but not SR-IOV virtual
    functions) such accesses may (will?) be treated as Unsupported
    Requests, causing respective errors to be surfaced, potentially in the
    form of NMIs that may be fatal to the hypervisor or Dom0 is different
    ways. Hence rather than carrying out these accesses, we should avoid
    them where we can, and use alternative (e.g. PCI config space based)
    mechanisms to achieve at least the same effect.
    
    At this time it continues to be unclear whether this is fixing an
    actual bug or is rather just working around bogus (but apparently
    common) system behavior.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/irq.c |    6 +-
 xen/arch/x86/msi.c |  142 ++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 119 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 78e3f2e..62fb319 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -217,9 +217,9 @@ void destroy_irq(unsigned int irq)
     }
 
     spin_lock_irqsave(&desc->lock, flags);
-    desc->status  |= IRQ_DISABLED;
     desc->status  &= ~IRQ_GUEST;
     desc->handler->shutdown(desc);
+    desc->status |= IRQ_DISABLED;
     action = desc->action;
     desc->action  = NULL;
     desc->msi_desc = NULL;
@@ -995,8 +995,8 @@ void __init release_irq(unsigned int irq, const void *dev_id)
     spin_lock_irqsave(&desc->lock,flags);
     action = desc->action;
     desc->action  = NULL;
-    desc->status |= IRQ_DISABLED;
     desc->handler->shutdown(desc);
+    desc->status |= IRQ_DISABLED;
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
@@ -1732,8 +1732,8 @@ static irq_guest_action_t *__pirq_guest_unbind(
     BUG_ON(action->in_flight != 0);
 
     /* Disabling IRQ before releasing the desc_lock avoids an IRQ storm. */
-    desc->status |= IRQ_DISABLED;
     desc->handler->disable(desc);
+    desc->status |= IRQ_DISABLED;
 
     /*
      * Mark any remaining pending EOIs as ready to flush.
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 321b6aa..dfa9329 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -123,6 +123,27 @@ static void msix_put_fixmap(struct arch_msix *msix, int idx)
     spin_unlock(&msix->table_lock);
 }
 
+static bool_t memory_decoded(const struct pci_dev *dev)
+{
+    u8 bus, slot, func;
+
+    if ( !dev->info.is_virtfn )
+    {
+        bus = dev->bus;
+        slot = PCI_SLOT(dev->devfn);
+        func = PCI_FUNC(dev->devfn);
+    }
+    else
+    {
+        bus = dev->info.physfn.bus;
+        slot = PCI_SLOT(dev->info.physfn.devfn);
+        func = PCI_FUNC(dev->info.physfn.devfn);
+    }
+
+    return !!(pci_conf_read16(dev->seg, bus, slot, func, PCI_COMMAND) &
+              PCI_COMMAND_MEMORY);
+}
+
 /*
  * MSI message composition
  */
@@ -166,7 +187,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
     }
 }
 
-static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     switch ( entry->msi_attrib.type )
     {
@@ -201,6 +222,8 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            return 0;
         msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
         msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
@@ -212,6 +235,8 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 
     if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
+
+    return 1;
 }
 
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
@@ -262,6 +287,8 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            return -ENXIO;
         writel(msg->address_lo,
                base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         writel(msg->address_hi,
@@ -289,7 +316,8 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
     ASSERT(spin_is_locked(&desc->lock));
 
     memset(&msg, 0, sizeof(msg));
-    read_msi_msg(msi_desc, &msg);
+    if ( !read_msi_msg(msi_desc, &msg) )
+        return;
 
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
@@ -349,23 +377,27 @@ int msi_maskable_irq(const struct msi_desc *entry)
            || entry->msi_attrib.maskbit;
 }
 
-static void msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
+static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
 {
     struct msi_desc *entry = desc->msi_desc;
+    struct pci_dev *pdev;
+    u16 seg;
+    u8 bus, slot, func;
     bool_t flag = host || guest;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
+    pdev = entry->dev;
+    seg = pdev->seg;
+    bus = pdev->bus;
+    slot = PCI_SLOT(pdev->devfn);
+    func = PCI_FUNC(pdev->devfn);
     switch ( entry->msi_attrib.type )
     {
     case PCI_CAP_ID_MSI:
         if ( entry->msi_attrib.maskbit )
         {
             u32 mask_bits;
-            u16 seg = entry->dev->seg;
-            u8 bus = entry->dev->bus;
-            u8 slot = PCI_SLOT(entry->dev->devfn);
-            u8 func = PCI_FUNC(entry->dev->devfn);
 
             mask_bits = pci_conf_read32(seg, bus, slot, func, entry->msi.mpos);
             mask_bits &= ~((u32)1 << entry->msi_attrib.entry_nr);
@@ -374,25 +406,54 @@ static void msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
         }
         break;
     case PCI_CAP_ID_MSIX:
-    {
-        int offset = PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET;
-        writel(flag, entry->mask_base + offset);
-        readl(entry->mask_base + offset);
-        break;
-    }
+        if ( likely(memory_decoded(pdev)) )
+        {
+            writel(flag, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+            readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+            break;
+        }
+        if ( flag )
+        {
+            u16 control;
+            domid_t domid = pdev->domain->domain_id;
+
+            pdev->msix->host_maskall = 1;
+            control = pci_conf_read16(seg, bus, slot, func,
+                                      msix_control_reg(entry->msi_attrib.pos));
+            if ( control & PCI_MSIX_FLAGS_MASKALL )
+                break;
+            pci_conf_write16(seg, bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | PCI_MSIX_FLAGS_MASKALL);
+            if ( pdev->msix->warned != domid )
+            {
+                pdev->msix->warned = domid;
+                printk(XENLOG_G_WARNING
+                       "cannot mask IRQ %d: masked MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
+                       desc->irq, domid, pdev->seg, pdev->bus,
+                       PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
+            }
+            break;
+        }
+        /* fall through */
     default:
-        BUG();
-        break;
+        return 0;
     }
     entry->msi_attrib.host_masked = host;
     entry->msi_attrib.guest_masked = guest;
+
+    return 1;
 }
 
 static int msi_get_mask_bit(const struct msi_desc *entry)
 {
-    switch (entry->msi_attrib.type) {
+    if ( !entry->dev )
+        return -1;
+
+    switch ( entry->msi_attrib.type )
+    {
     case PCI_CAP_ID_MSI:
-        if (!entry->dev || !entry->msi_attrib.maskbit)
+        if ( !entry->msi_attrib.maskbit )
             break;
         return (pci_conf_read32(entry->dev->seg, entry->dev->bus,
                                 PCI_SLOT(entry->dev->devfn),
@@ -400,6 +461,8 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
                                 entry->msi.mpos) >>
                 entry->msi_attrib.entry_nr) & 1;
     case PCI_CAP_ID_MSIX:
+        if ( unlikely(!memory_decoded(entry->dev)) )
+            break;
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
     return -1;
@@ -407,12 +470,16 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
 
 void mask_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 1, desc->msi_desc->msi_attrib.guest_masked);
+    if ( unlikely(!msi_set_mask_bit(desc, 1,
+                                    desc->msi_desc->msi_attrib.guest_masked)) )
+        BUG_ON(!(desc->status & IRQ_DISABLED));
 }
 
 void unmask_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 0, desc->msi_desc->msi_attrib.guest_masked);
+    if ( unlikely(!msi_set_mask_bit(desc, 0,
+                                    desc->msi_desc->msi_attrib.guest_masked)) )
+        WARN();
 }
 
 void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
@@ -422,13 +489,15 @@ void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
 
 static unsigned int startup_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 0, !!(desc->status & IRQ_GUEST));
+    if ( unlikely(!msi_set_mask_bit(desc, 0, !!(desc->status & IRQ_GUEST))) )
+        WARN();
     return 0;
 }
 
 static void shutdown_msi_irq(struct irq_desc *desc)
 {
-    msi_set_mask_bit(desc, 1, 1);
+    if ( unlikely(!msi_set_mask_bit(desc, 1, 1)) )
+        BUG_ON(!(desc->status & IRQ_DISABLED));
 }
 
 void ack_nonmaskable_msi_irq(struct irq_desc *desc)
@@ -740,6 +809,9 @@ static int msix_capability_init(struct pci_dev *dev,
     control = pci_conf_read16(seg, bus, slot, func, msix_control_reg(pos));
     msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
 
+    if ( unlikely(!memory_decoded(dev)) )
+        return -ENXIO;
+
     if ( desc )
     {
         entry = alloc_msi_entry(1);
@@ -879,7 +951,8 @@ static int msix_capability_init(struct pci_dev *dev,
     ++msix->used_entries;
 
     /* Restore MSI-X enabled bits */
-    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                     control & ~PCI_MSIX_FLAGS_MASKALL);
 
     return 0;
 }
@@ -1024,8 +1097,16 @@ static void __pci_disable_msix(struct msi_desc *entry)
 
     BUG_ON(list_empty(&dev->msi_list));
 
-    writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-
+    if ( likely(memory_decoded(dev)) )
+        writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+    else if ( !(control & PCI_MSIX_FLAGS_MASKALL) )
+    {
+        printk(XENLOG_WARNING
+               "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
+               entry->irq, dev->seg, dev->bus,
+               PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+        control |= PCI_MSIX_FLAGS_MASKALL;
+    }
     pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     _pci_cleanup_msix(dev->msix);
@@ -1199,15 +1280,24 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             nr = entry->msi.nvec;
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        {
             msix_set_enable(pdev, 0);
+            if ( unlikely(!memory_decoded(pdev)) )
+            {
+                spin_unlock_irqrestore(&desc->lock, flags);
+                return -ENXIO;
+            }
+        }
 
         msg = entry->msg;
         write_msi_msg(entry, &msg);
 
         for ( i = 0; ; )
         {
-            msi_set_mask_bit(desc, entry[i].msi_attrib.host_masked,
-                             entry[i].msi_attrib.guest_masked);
+            if ( unlikely(!msi_set_mask_bit(desc,
+                                            entry[i].msi_attrib.host_masked,
+                                            entry[i].msi_attrib.guest_masked)) )
+                BUG();
 
             if ( !--nr )
                 break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLASa-00051S-T7; Fri, 31 Jul 2015 13:34:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASY-00051A-Rp
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:51 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	D9/D9-28221-A797BB55; Fri, 31 Jul 2015 13:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1438349687!36891292!1
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 11523 invoked from network); 31 Jul 2015 13:34:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:34:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASV-0004P0-Nb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASV-0006jv-MM
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:47 +0000
Date: Fri, 31 Jul 2015 13:34:47 +0000
Message-Id: <E1ZLASV-0006jv-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: access MSI-X table only
	after having enabled MSI-X
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0dba393db07331e9cff42df10e95b67547dfdb3e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:15:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:15:39 2015 +0200

    x86/MSI-X: access MSI-X table only after having enabled MSI-X
    
    As done in Linux by f598282f51 ("PCI: Fix the NIU MSI-X problem in a
    better way") and its broken predecessor, make sure we don't access the
    MSI-X table without having enabled MSI-X first, using the mask-all flag
    instead to prevent interrupts from occurring.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |  155 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index dfa9329..3f122b7 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -144,6 +144,17 @@ static bool_t memory_decoded(const struct pci_dev *dev)
               PCI_COMMAND_MEMORY);
 }
 
+static bool_t msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
+{
+    u16 control = pci_conf_read16(dev->seg, dev->bus, PCI_SLOT(dev->devfn),
+                                  PCI_FUNC(dev->devfn), msix_control_reg(pos));
+
+    if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+        return 0;
+
+    return memory_decoded(dev);
+}
+
 /*
  * MSI message composition
  */
@@ -222,7 +233,8 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             return 0;
         msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
@@ -287,7 +299,8 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             return -ENXIO;
         writel(msg->address_lo,
                base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
@@ -381,9 +394,9 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
 {
     struct msi_desc *entry = desc->msi_desc;
     struct pci_dev *pdev;
-    u16 seg;
+    u16 seg, control;
     u8 bus, slot, func;
-    bool_t flag = host || guest;
+    bool_t flag = host || guest, maskall;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
@@ -406,36 +419,45 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
         }
         break;
     case PCI_CAP_ID_MSIX:
+        maskall = pdev->msix->host_maskall;
+        control = pci_conf_read16(seg, bus, slot, func,
+                                  msix_control_reg(entry->msi_attrib.pos));
+        if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
+        {
+            pdev->msix->host_maskall = 1;
+            pci_conf_write16(seg, bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
+        }
         if ( likely(memory_decoded(pdev)) )
         {
             writel(flag, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
             readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-            break;
+            if ( likely(control & PCI_MSIX_FLAGS_ENABLE) )
+                break;
+            flag = 1;
         }
-        if ( flag )
+        else if ( flag && !(control & PCI_MSIX_FLAGS_MASKALL) )
         {
-            u16 control;
             domid_t domid = pdev->domain->domain_id;
 
-            pdev->msix->host_maskall = 1;
-            control = pci_conf_read16(seg, bus, slot, func,
-                                      msix_control_reg(entry->msi_attrib.pos));
-            if ( control & PCI_MSIX_FLAGS_MASKALL )
-                break;
-            pci_conf_write16(seg, bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
-                             control | PCI_MSIX_FLAGS_MASKALL);
+            maskall = 1;
             if ( pdev->msix->warned != domid )
             {
                 pdev->msix->warned = domid;
                 printk(XENLOG_G_WARNING
-                       "cannot mask IRQ %d: masked MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
+                       "cannot mask IRQ %d: masking MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
                        desc->irq, domid, pdev->seg, pdev->bus,
                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
             }
-            break;
         }
-        /* fall through */
+        pdev->msix->host_maskall = maskall;
+        if ( maskall || pdev->msix->guest_maskall )
+            control |= PCI_MSIX_FLAGS_MASKALL;
+        pci_conf_write16(seg, bus, slot, func,
+                         msix_control_reg(entry->msi_attrib.pos), control);
+        return flag;
     default:
         return 0;
     }
@@ -461,7 +483,8 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
                                 entry->msi.mpos) >>
                 entry->msi_attrib.entry_nr) & 1;
     case PCI_CAP_ID_MSIX:
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             break;
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
@@ -564,9 +587,31 @@ static struct msi_desc *alloc_msi_entry(unsigned int nr)
 
 int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc)
 {
-    return __setup_msi_irq(desc, msidesc,
-                           msi_maskable_irq(msidesc) ? &pci_msi_maskable
-                                                     : &pci_msi_nonmaskable);
+    const struct pci_dev *pdev = msidesc->dev;
+    unsigned int cpos = msix_control_reg(msidesc->msi_attrib.pos);
+    u16 control = ~0;
+    int rc;
+
+    if ( msidesc->msi_attrib.type == PCI_CAP_ID_MSIX )
+    {
+        control = pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                                  PCI_FUNC(pdev->devfn), cpos);
+        if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+            pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                             PCI_FUNC(pdev->devfn), cpos,
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
+    }
+
+    rc = __setup_msi_irq(desc, msidesc,
+                         msi_maskable_irq(msidesc) ? &pci_msi_maskable
+                                                   : &pci_msi_nonmaskable);
+
+    if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+        pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                         PCI_FUNC(pdev->devfn), cpos, control);
+
+    return rc;
 }
 
 int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
@@ -803,20 +848,38 @@ static int msix_capability_init(struct pci_dev *dev,
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
+    bool_t maskall = msix->host_maskall;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
     control = pci_conf_read16(seg, bus, slot, func, msix_control_reg(pos));
-    msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
+    /*
+     * Ensure MSI-X interrupts are masked during setup. Some devices require
+     * MSI-X to be enabled before we can touch the MSI-X registers. We need
+     * to mask all the vectors to prevent interrupts coming in before they're
+     * fully set up.
+     */
+    msix->host_maskall = 1;
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                     control | (PCI_MSIX_FLAGS_ENABLE |
+                                PCI_MSIX_FLAGS_MASKALL));
 
     if ( unlikely(!memory_decoded(dev)) )
+    {
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control & ~PCI_MSIX_FLAGS_ENABLE);
         return -ENXIO;
+    }
 
     if ( desc )
     {
         entry = alloc_msi_entry(1);
         if ( !entry )
+        {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             return -ENOMEM;
+        }
         ASSERT(msi);
     }
 
@@ -847,6 +910,8 @@ static int msix_capability_init(struct pci_dev *dev,
     {
         if ( !msi || !msi->table_base )
         {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             xfree(entry);
             return -ENXIO;
         }
@@ -889,6 +954,8 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             xfree(entry);
             return idx;
         }
@@ -915,7 +982,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
     if ( !msix->used_entries )
     {
-        msix->host_maskall = 0;
+        maskall = 0;
         if ( !msix->guest_maskall )
             control &= ~PCI_MSIX_FLAGS_MASKALL;
         else
@@ -951,8 +1018,8 @@ static int msix_capability_init(struct pci_dev *dev,
     ++msix->used_entries;
 
     /* Restore MSI-X enabled bits */
-    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                     control & ~PCI_MSIX_FLAGS_MASKALL);
+    msix->host_maskall = maskall;
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     return 0;
 }
@@ -1092,8 +1159,15 @@ static void __pci_disable_msix(struct msi_desc *entry)
                                            PCI_CAP_ID_MSIX);
     u16 control = pci_conf_read16(seg, bus, slot, func,
                                   msix_control_reg(entry->msi_attrib.pos));
+    bool_t maskall = dev->msix->host_maskall;
 
-    msix_set_enable(dev, 0);
+    if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
+    {
+        dev->msix->host_maskall = 1;
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control | (PCI_MSIX_FLAGS_ENABLE |
+                                    PCI_MSIX_FLAGS_MASKALL));
+    }
 
     BUG_ON(list_empty(&dev->msi_list));
 
@@ -1105,8 +1179,11 @@ static void __pci_disable_msix(struct msi_desc *entry)
                "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
                entry->irq, dev->seg, dev->bus,
                PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-        control |= PCI_MSIX_FLAGS_MASKALL;
+        maskall = 1;
     }
+    dev->msix->host_maskall = maskall;
+    if ( maskall || dev->msix->guest_maskall )
+        control |= PCI_MSIX_FLAGS_MASKALL;
     pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     _pci_cleanup_msix(dev->msix);
@@ -1255,6 +1332,8 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     list_for_each_entry_safe( entry, tmp, &pdev->msi_list, list )
     {
         unsigned int i = 0, nr = 1;
+        u16 control = 0;
+        u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
 
         irq = entry->irq;
         desc = &irq_desc[irq];
@@ -1281,10 +1360,18 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
         {
-            msix_set_enable(pdev, 0);
+            control = pci_conf_read16(pdev->seg, pdev->bus, slot, func,
+                                      msix_control_reg(entry->msi_attrib.pos));
+            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
             if ( unlikely(!memory_decoded(pdev)) )
             {
                 spin_unlock_irqrestore(&desc->lock, flags);
+                pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                                 msix_control_reg(entry->msi_attrib.pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
                 return -ENXIO;
             }
         }
@@ -1314,11 +1401,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
         {
             unsigned int cpos = msi_control_reg(entry->msi_attrib.pos);
-            u16 control = pci_conf_read16(pdev->seg, pdev->bus,
-                                          PCI_SLOT(pdev->devfn),
-                                          PCI_FUNC(pdev->devfn), cpos);
 
-            control &= ~PCI_MSI_FLAGS_QSIZE;
+            control = pci_conf_read16(pdev->seg, pdev->bus, slot, func, cpos) &
+                      ~PCI_MSI_FLAGS_QSIZE;
             multi_msi_enable(control, entry->msi.nvec);
             pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
                              PCI_FUNC(pdev->devfn), cpos, control);
@@ -1326,7 +1411,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             msi_set_enable(pdev, 1);
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-            msix_set_enable(pdev, 1);
+            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | PCI_MSIX_FLAGS_ENABLE);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:34:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:34: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 1ZLASa-00051S-T7; Fri, 31 Jul 2015 13:34:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASY-00051A-Rp
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:51 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	D9/D9-28221-A797BB55; Fri, 31 Jul 2015 13:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1438349687!36891292!1
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 11523 invoked from network); 31 Jul 2015 13:34:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:34:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASV-0004P0-Nb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASV-0006jv-MM
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:47 +0000
Date: Fri, 31 Jul 2015 13:34:47 +0000
Message-Id: <E1ZLASV-0006jv-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: access MSI-X table only
	after having enabled MSI-X
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0dba393db07331e9cff42df10e95b67547dfdb3e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:15:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:15:39 2015 +0200

    x86/MSI-X: access MSI-X table only after having enabled MSI-X
    
    As done in Linux by f598282f51 ("PCI: Fix the NIU MSI-X problem in a
    better way") and its broken predecessor, make sure we don't access the
    MSI-X table without having enabled MSI-X first, using the mask-all flag
    instead to prevent interrupts from occurring.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |  155 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index dfa9329..3f122b7 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -144,6 +144,17 @@ static bool_t memory_decoded(const struct pci_dev *dev)
               PCI_COMMAND_MEMORY);
 }
 
+static bool_t msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
+{
+    u16 control = pci_conf_read16(dev->seg, dev->bus, PCI_SLOT(dev->devfn),
+                                  PCI_FUNC(dev->devfn), msix_control_reg(pos));
+
+    if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+        return 0;
+
+    return memory_decoded(dev);
+}
+
 /*
  * MSI message composition
  */
@@ -222,7 +233,8 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             return 0;
         msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
@@ -287,7 +299,8 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     {
         void __iomem *base = entry->mask_base;
 
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             return -ENXIO;
         writel(msg->address_lo,
                base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
@@ -381,9 +394,9 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
 {
     struct msi_desc *entry = desc->msi_desc;
     struct pci_dev *pdev;
-    u16 seg;
+    u16 seg, control;
     u8 bus, slot, func;
-    bool_t flag = host || guest;
+    bool_t flag = host || guest, maskall;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
@@ -406,36 +419,45 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
         }
         break;
     case PCI_CAP_ID_MSIX:
+        maskall = pdev->msix->host_maskall;
+        control = pci_conf_read16(seg, bus, slot, func,
+                                  msix_control_reg(entry->msi_attrib.pos));
+        if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
+        {
+            pdev->msix->host_maskall = 1;
+            pci_conf_write16(seg, bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
+        }
         if ( likely(memory_decoded(pdev)) )
         {
             writel(flag, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
             readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-            break;
+            if ( likely(control & PCI_MSIX_FLAGS_ENABLE) )
+                break;
+            flag = 1;
         }
-        if ( flag )
+        else if ( flag && !(control & PCI_MSIX_FLAGS_MASKALL) )
         {
-            u16 control;
             domid_t domid = pdev->domain->domain_id;
 
-            pdev->msix->host_maskall = 1;
-            control = pci_conf_read16(seg, bus, slot, func,
-                                      msix_control_reg(entry->msi_attrib.pos));
-            if ( control & PCI_MSIX_FLAGS_MASKALL )
-                break;
-            pci_conf_write16(seg, bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
-                             control | PCI_MSIX_FLAGS_MASKALL);
+            maskall = 1;
             if ( pdev->msix->warned != domid )
             {
                 pdev->msix->warned = domid;
                 printk(XENLOG_G_WARNING
-                       "cannot mask IRQ %d: masked MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
+                       "cannot mask IRQ %d: masking MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
                        desc->irq, domid, pdev->seg, pdev->bus,
                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
             }
-            break;
         }
-        /* fall through */
+        pdev->msix->host_maskall = maskall;
+        if ( maskall || pdev->msix->guest_maskall )
+            control |= PCI_MSIX_FLAGS_MASKALL;
+        pci_conf_write16(seg, bus, slot, func,
+                         msix_control_reg(entry->msi_attrib.pos), control);
+        return flag;
     default:
         return 0;
     }
@@ -461,7 +483,8 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
                                 entry->msi.mpos) >>
                 entry->msi_attrib.entry_nr) & 1;
     case PCI_CAP_ID_MSIX:
-        if ( unlikely(!memory_decoded(entry->dev)) )
+        if ( unlikely(!msix_memory_decoded(entry->dev,
+                                           entry->msi_attrib.pos)) )
             break;
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
@@ -564,9 +587,31 @@ static struct msi_desc *alloc_msi_entry(unsigned int nr)
 
 int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc)
 {
-    return __setup_msi_irq(desc, msidesc,
-                           msi_maskable_irq(msidesc) ? &pci_msi_maskable
-                                                     : &pci_msi_nonmaskable);
+    const struct pci_dev *pdev = msidesc->dev;
+    unsigned int cpos = msix_control_reg(msidesc->msi_attrib.pos);
+    u16 control = ~0;
+    int rc;
+
+    if ( msidesc->msi_attrib.type == PCI_CAP_ID_MSIX )
+    {
+        control = pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                                  PCI_FUNC(pdev->devfn), cpos);
+        if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+            pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                             PCI_FUNC(pdev->devfn), cpos,
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
+    }
+
+    rc = __setup_msi_irq(desc, msidesc,
+                         msi_maskable_irq(msidesc) ? &pci_msi_maskable
+                                                   : &pci_msi_nonmaskable);
+
+    if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
+        pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                         PCI_FUNC(pdev->devfn), cpos, control);
+
+    return rc;
 }
 
 int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
@@ -803,20 +848,38 @@ static int msix_capability_init(struct pci_dev *dev,
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
+    bool_t maskall = msix->host_maskall;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
     control = pci_conf_read16(seg, bus, slot, func, msix_control_reg(pos));
-    msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
+    /*
+     * Ensure MSI-X interrupts are masked during setup. Some devices require
+     * MSI-X to be enabled before we can touch the MSI-X registers. We need
+     * to mask all the vectors to prevent interrupts coming in before they're
+     * fully set up.
+     */
+    msix->host_maskall = 1;
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                     control | (PCI_MSIX_FLAGS_ENABLE |
+                                PCI_MSIX_FLAGS_MASKALL));
 
     if ( unlikely(!memory_decoded(dev)) )
+    {
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control & ~PCI_MSIX_FLAGS_ENABLE);
         return -ENXIO;
+    }
 
     if ( desc )
     {
         entry = alloc_msi_entry(1);
         if ( !entry )
+        {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             return -ENOMEM;
+        }
         ASSERT(msi);
     }
 
@@ -847,6 +910,8 @@ static int msix_capability_init(struct pci_dev *dev,
     {
         if ( !msi || !msi->table_base )
         {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             xfree(entry);
             return -ENXIO;
         }
@@ -889,6 +954,8 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
+            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                             control & ~PCI_MSIX_FLAGS_ENABLE);
             xfree(entry);
             return idx;
         }
@@ -915,7 +982,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
     if ( !msix->used_entries )
     {
-        msix->host_maskall = 0;
+        maskall = 0;
         if ( !msix->guest_maskall )
             control &= ~PCI_MSIX_FLAGS_MASKALL;
         else
@@ -951,8 +1018,8 @@ static int msix_capability_init(struct pci_dev *dev,
     ++msix->used_entries;
 
     /* Restore MSI-X enabled bits */
-    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                     control & ~PCI_MSIX_FLAGS_MASKALL);
+    msix->host_maskall = maskall;
+    pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     return 0;
 }
@@ -1092,8 +1159,15 @@ static void __pci_disable_msix(struct msi_desc *entry)
                                            PCI_CAP_ID_MSIX);
     u16 control = pci_conf_read16(seg, bus, slot, func,
                                   msix_control_reg(entry->msi_attrib.pos));
+    bool_t maskall = dev->msix->host_maskall;
 
-    msix_set_enable(dev, 0);
+    if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
+    {
+        dev->msix->host_maskall = 1;
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control | (PCI_MSIX_FLAGS_ENABLE |
+                                    PCI_MSIX_FLAGS_MASKALL));
+    }
 
     BUG_ON(list_empty(&dev->msi_list));
 
@@ -1105,8 +1179,11 @@ static void __pci_disable_msix(struct msi_desc *entry)
                "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
                entry->irq, dev->seg, dev->bus,
                PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-        control |= PCI_MSIX_FLAGS_MASKALL;
+        maskall = 1;
     }
+    dev->msix->host_maskall = maskall;
+    if ( maskall || dev->msix->guest_maskall )
+        control |= PCI_MSIX_FLAGS_MASKALL;
     pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control);
 
     _pci_cleanup_msix(dev->msix);
@@ -1255,6 +1332,8 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     list_for_each_entry_safe( entry, tmp, &pdev->msi_list, list )
     {
         unsigned int i = 0, nr = 1;
+        u16 control = 0;
+        u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
 
         irq = entry->irq;
         desc = &irq_desc[irq];
@@ -1281,10 +1360,18 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
         {
-            msix_set_enable(pdev, 0);
+            control = pci_conf_read16(pdev->seg, pdev->bus, slot, func,
+                                      msix_control_reg(entry->msi_attrib.pos));
+            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | (PCI_MSIX_FLAGS_ENABLE |
+                                        PCI_MSIX_FLAGS_MASKALL));
             if ( unlikely(!memory_decoded(pdev)) )
             {
                 spin_unlock_irqrestore(&desc->lock, flags);
+                pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                                 msix_control_reg(entry->msi_attrib.pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
                 return -ENXIO;
             }
         }
@@ -1314,11 +1401,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
         {
             unsigned int cpos = msi_control_reg(entry->msi_attrib.pos);
-            u16 control = pci_conf_read16(pdev->seg, pdev->bus,
-                                          PCI_SLOT(pdev->devfn),
-                                          PCI_FUNC(pdev->devfn), cpos);
 
-            control &= ~PCI_MSI_FLAGS_QSIZE;
+            control = pci_conf_read16(pdev->seg, pdev->bus, slot, func, cpos) &
+                      ~PCI_MSI_FLAGS_QSIZE;
             multi_msi_enable(control, entry->msi.nvec);
             pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
                              PCI_FUNC(pdev->devfn), cpos, control);
@@ -1326,7 +1411,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             msi_set_enable(pdev, 1);
         }
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-            msix_set_enable(pdev, 1);
+            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                             msix_control_reg(entry->msi_attrib.pos),
+                             control | PCI_MSIX_FLAGS_ENABLE);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLASk-00053C-T3; Fri, 31 Jul 2015 13: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 1ZLASi-00052v-8J
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:00 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6C/0D-01421-3897BB55; Fri, 31 Jul 2015 13:34:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349698!30993773!1
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 1509 invoked from network); 31 Jul 2015 13:34: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;
	31 Jul 2015 13:34:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASf-0004PH-SP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASf-0006kg-RL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:57 +0000
Date: Fri, 31 Jul 2015 13:34:57 +0000
Message-Id: <E1ZLASf-0006kg-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: reduce fiddling with
	control register during restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 372900faf88d424136315cbd5d440fdcf22566a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:16:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:16:03 2015 +0200

    x86/MSI-X: reduce fiddling with control register during restore
    
    Rather than disabling and enabling MSI-X once per vector, do it just
    once per device.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3f122b7..3c8354d 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1314,6 +1314,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
     struct msi_msg msg;
+    u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
+    unsigned int type = 0, pos = 0;
+    u16 control = 0;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1332,8 +1335,6 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     list_for_each_entry_safe( entry, tmp, &pdev->msi_list, list )
     {
         unsigned int i = 0, nr = 1;
-        u16 control = 0;
-        u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
 
         irq = entry->irq;
         desc = &irq_desc[irq];
@@ -1350,31 +1351,38 @@ int pci_restore_msi_state(struct pci_dev *pdev)
                     pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
                     PCI_FUNC(pdev->devfn), i);
             spin_unlock_irqrestore(&desc->lock, flags);
+            if ( type == PCI_CAP_ID_MSIX )
+                pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                                 msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
             return -EINVAL;
         }
 
+        ASSERT(!type || type == entry->msi_attrib.type);
+        pos = entry->msi_attrib.pos;
         if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
         {
             msi_set_enable(pdev, 0);
             nr = entry->msi.nvec;
         }
-        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        else if ( !type && entry->msi_attrib.type == PCI_CAP_ID_MSIX )
         {
             control = pci_conf_read16(pdev->seg, pdev->bus, slot, func,
-                                      msix_control_reg(entry->msi_attrib.pos));
+                                      msix_control_reg(pos));
             pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
+                             msix_control_reg(pos),
                              control | (PCI_MSIX_FLAGS_ENABLE |
                                         PCI_MSIX_FLAGS_MASKALL));
             if ( unlikely(!memory_decoded(pdev)) )
             {
                 spin_unlock_irqrestore(&desc->lock, flags);
                 pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                                 msix_control_reg(entry->msi_attrib.pos),
+                                 msix_control_reg(pos),
                                  control & ~PCI_MSIX_FLAGS_ENABLE);
                 return -ENXIO;
             }
         }
+        type = entry->msi_attrib.type;
 
         msg = entry->msg;
         write_msi_msg(entry, &msg);
@@ -1398,9 +1406,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
-        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
+        if ( type == PCI_CAP_ID_MSI )
         {
-            unsigned int cpos = msi_control_reg(entry->msi_attrib.pos);
+            unsigned int cpos = msi_control_reg(pos);
 
             control = pci_conf_read16(pdev->seg, pdev->bus, slot, func, cpos) &
                       ~PCI_MSI_FLAGS_QSIZE;
@@ -1410,12 +1418,13 @@ int pci_restore_msi_state(struct pci_dev *pdev)
 
             msi_set_enable(pdev, 1);
         }
-        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
-                             control | PCI_MSIX_FLAGS_ENABLE);
     }
 
+    if ( type == PCI_CAP_ID_MSIX )
+        pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                         msix_control_reg(pos),
+                         control | PCI_MSIX_FLAGS_ENABLE);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLASk-00053C-T3; Fri, 31 Jul 2015 13: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 1ZLASi-00052v-8J
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:00 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6C/0D-01421-3897BB55; Fri, 31 Jul 2015 13:34:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349698!30993773!1
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 1509 invoked from network); 31 Jul 2015 13:34: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;
	31 Jul 2015 13:34:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASf-0004PH-SP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASf-0006kg-RL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:34:57 +0000
Date: Fri, 31 Jul 2015 13:34:57 +0000
Message-Id: <E1ZLASf-0006kg-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI-X: reduce fiddling with
	control register during restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 372900faf88d424136315cbd5d440fdcf22566a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:16:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:16:03 2015 +0200

    x86/MSI-X: reduce fiddling with control register during restore
    
    Rather than disabling and enabling MSI-X once per vector, do it just
    once per device.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3f122b7..3c8354d 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1314,6 +1314,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
     struct msi_msg msg;
+    u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
+    unsigned int type = 0, pos = 0;
+    u16 control = 0;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1332,8 +1335,6 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     list_for_each_entry_safe( entry, tmp, &pdev->msi_list, list )
     {
         unsigned int i = 0, nr = 1;
-        u16 control = 0;
-        u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
 
         irq = entry->irq;
         desc = &irq_desc[irq];
@@ -1350,31 +1351,38 @@ int pci_restore_msi_state(struct pci_dev *pdev)
                     pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
                     PCI_FUNC(pdev->devfn), i);
             spin_unlock_irqrestore(&desc->lock, flags);
+            if ( type == PCI_CAP_ID_MSIX )
+                pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                                 msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
             return -EINVAL;
         }
 
+        ASSERT(!type || type == entry->msi_attrib.type);
+        pos = entry->msi_attrib.pos;
         if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
         {
             msi_set_enable(pdev, 0);
             nr = entry->msi.nvec;
         }
-        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        else if ( !type && entry->msi_attrib.type == PCI_CAP_ID_MSIX )
         {
             control = pci_conf_read16(pdev->seg, pdev->bus, slot, func,
-                                      msix_control_reg(entry->msi_attrib.pos));
+                                      msix_control_reg(pos));
             pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
+                             msix_control_reg(pos),
                              control | (PCI_MSIX_FLAGS_ENABLE |
                                         PCI_MSIX_FLAGS_MASKALL));
             if ( unlikely(!memory_decoded(pdev)) )
             {
                 spin_unlock_irqrestore(&desc->lock, flags);
                 pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                                 msix_control_reg(entry->msi_attrib.pos),
+                                 msix_control_reg(pos),
                                  control & ~PCI_MSIX_FLAGS_ENABLE);
                 return -ENXIO;
             }
         }
+        type = entry->msi_attrib.type;
 
         msg = entry->msg;
         write_msi_msg(entry, &msg);
@@ -1398,9 +1406,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
-        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
+        if ( type == PCI_CAP_ID_MSI )
         {
-            unsigned int cpos = msi_control_reg(entry->msi_attrib.pos);
+            unsigned int cpos = msi_control_reg(pos);
 
             control = pci_conf_read16(pdev->seg, pdev->bus, slot, func, cpos) &
                       ~PCI_MSI_FLAGS_QSIZE;
@@ -1410,12 +1418,13 @@ int pci_restore_msi_state(struct pci_dev *pdev)
 
             msi_set_enable(pdev, 1);
         }
-        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-            pci_conf_write16(pdev->seg, pdev->bus, slot, func,
-                             msix_control_reg(entry->msi_attrib.pos),
-                             control | PCI_MSIX_FLAGS_ENABLE);
     }
 
+    if ( type == PCI_CAP_ID_MSIX )
+        pci_conf_write16(pdev->seg, pdev->bus, slot, func,
+                         msix_control_reg(pos),
+                         control | PCI_MSIX_FLAGS_ENABLE);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:35:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLASw-00054n-2j; Fri, 31 Jul 2015 13:35: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 1ZLASu-00054f-1I
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:12 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	2B/A8-17885-F897BB55; Fri, 31 Jul 2015 13:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1438349710!22106114!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 25873 invoked from network); 31 Jul 2015 13:35:10 -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;
	31 Jul 2015 13:35:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASq-0004Pp-1j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASq-0006lV-08
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:08 +0000
Date: Fri, 31 Jul 2015 13:35:08 +0000
Message-Id: <E1ZLASq-0006lV-08@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: properly track guest masking
	requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa7c1fdf9dd04a1287f4770906b2c41b88a28228
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:16:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:16:27 2015 +0200

    x86/MSI: properly track guest masking requests
    
    ... by monitoring writes to the mask register.
    
    This allows reverting the main effect of the XSA-129 patches in qemu.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3c8354d..fa95048 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1303,6 +1303,37 @@ int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
         return 1;
     }
 
+    entry = find_msi_entry(pdev, -1, PCI_CAP_ID_MSI);
+    if ( entry && entry->msi_attrib.maskbit )
+    {
+        uint16_t cntl;
+        uint32_t unused;
+
+        pos = entry->msi_attrib.pos;
+        if ( reg < pos || reg >= entry->msi.mpos + 8 )
+            return 0;
+
+        if ( reg == msi_control_reg(pos) )
+            return size == 2 ? 1 : -EACCES;
+        if ( reg < entry->msi.mpos || reg >= entry->msi.mpos + 4 || size != 4 )
+            return -EACCES;
+
+        cntl = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
+        unused = ~(uint32_t)0 >> (32 - multi_msi_capable(cntl));
+        for ( pos = 0; pos < entry->msi.nvec; ++pos, ++entry )
+        {
+            entry->msi_attrib.guest_masked =
+                *data >> entry->msi_attrib.entry_nr;
+            if ( entry->msi_attrib.host_masked )
+                *data |= 1 << pos;
+            unused &= ~(1 << pos);
+        }
+
+        *data |= unused;
+
+        return 1;
+    }
+
     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 Jul 31 13:35:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLASw-00054n-2j; Fri, 31 Jul 2015 13:35: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 1ZLASu-00054f-1I
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:12 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	2B/A8-17885-F897BB55; Fri, 31 Jul 2015 13:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1438349710!22106114!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 25873 invoked from network); 31 Jul 2015 13:35:10 -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;
	31 Jul 2015 13:35:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASq-0004Pp-1j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLASq-0006lV-08
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:08 +0000
Date: Fri, 31 Jul 2015 13:35:08 +0000
Message-Id: <E1ZLASq-0006lV-08@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: properly track guest masking
	requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa7c1fdf9dd04a1287f4770906b2c41b88a28228
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:16:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:16:27 2015 +0200

    x86/MSI: properly track guest masking requests
    
    ... by monitoring writes to the mask register.
    
    This allows reverting the main effect of the XSA-129 patches in qemu.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3c8354d..fa95048 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1303,6 +1303,37 @@ int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
         return 1;
     }
 
+    entry = find_msi_entry(pdev, -1, PCI_CAP_ID_MSI);
+    if ( entry && entry->msi_attrib.maskbit )
+    {
+        uint16_t cntl;
+        uint32_t unused;
+
+        pos = entry->msi_attrib.pos;
+        if ( reg < pos || reg >= entry->msi.mpos + 8 )
+            return 0;
+
+        if ( reg == msi_control_reg(pos) )
+            return size == 2 ? 1 : -EACCES;
+        if ( reg < entry->msi.mpos || reg >= entry->msi.mpos + 4 || size != 4 )
+            return -EACCES;
+
+        cntl = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
+        unused = ~(uint32_t)0 >> (32 - multi_msi_capable(cntl));
+        for ( pos = 0; pos < entry->msi.nvec; ++pos, ++entry )
+        {
+            entry->msi_attrib.guest_masked =
+                *data >> entry->msi_attrib.entry_nr;
+            if ( entry->msi_attrib.host_masked )
+                *data |= 1 << pos;
+            unused &= ~(1 << pos);
+        }
+
+        *data |= unused;
+
+        return 1;
+    }
+
     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 Jul 31 13:35:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATC-00056p-5Z; Fri, 31 Jul 2015 13:35:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATA-00056Z-3g
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:28 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	95/A5-24856-F997BB55; Fri, 31 Jul 2015 13:35:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438349725!24954325!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 19655 invoked from network); 31 Jul 2015 13:35:26 -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;
	31 Jul 2015 13:35:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAT7-0004Q0-1r
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAT1-0006lv-W2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:20 +0000
Date: Fri, 31 Jul 2015 13:35:19 +0000
Message-Id: <E1ZLAT1-0006lv-W2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PCI: intercept all PV Dom0 MMCFG
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9256f66c1606cd9339412bff7fbc7bd9e8beb28c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:17:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:17:08 2015 +0200

    x86/PCI: intercept all PV Dom0 MMCFG writes
    
    ... to hook up pci_conf_write_intercept() even for Dom0 not using
    method 1 accesses for the base part of PCI device config space.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c                 |  110 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/mmconfig_64.c |   63 +++++++++++----------
 xen/drivers/passthrough/pci.c     |    1 -
 xen/include/asm-x86/pci.h         |    2 +
 xen/include/xen/pci.h             |    1 -
 5 files changed, 140 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 342414f..f316377 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -734,6 +734,46 @@ static int update_xen_mappings(unsigned long mfn, unsigned long cacheattr)
     return err;
 }
 
+#ifndef NDEBUG
+struct mmio_emul_range_ctxt {
+    const struct domain *d;
+    unsigned long mfn;
+};
+
+static int print_mmio_emul_range(unsigned long s, unsigned long e, void *arg)
+{
+    const struct mmio_emul_range_ctxt *ctxt = arg;
+
+    if ( ctxt->mfn > e )
+        return 0;
+
+    if ( ctxt->mfn >= s )
+    {
+        static DEFINE_SPINLOCK(last_lock);
+        static const struct domain *last_d;
+        static unsigned long last_s = ~0UL, last_e;
+        bool_t print = 0;
+
+        spin_lock(&last_lock);
+        if ( last_d != ctxt->d || last_s != s || last_e != e )
+        {
+            last_d = ctxt->d;
+            last_s = s;
+            last_e = e;
+            print = 1;
+        }
+        spin_unlock(&last_lock);
+
+        if ( print )
+            printk(XENLOG_G_INFO
+                   "d%d: Forcing write emulation on MFNs %lx-%lx\n",
+                   ctxt->d->domain_id, s, e);
+    }
+
+    return 1;
+}
+#endif
+
 int
 get_page_from_l1e(
     l1_pgentry_t l1e, struct domain *l1e_owner, struct domain *pg_owner)
@@ -757,6 +797,11 @@ get_page_from_l1e(
     if ( !mfn_valid(mfn) ||
          (real_pg_owner = page_get_owner_and_reference(page)) == dom_io )
     {
+#ifndef NDEBUG
+        const unsigned long *ro_map;
+        unsigned int seg, bdf;
+#endif
+
         /* Only needed the reference to confirm dom_io ownership. */
         if ( mfn_valid(mfn) )
             put_page(page);
@@ -792,9 +837,20 @@ get_page_from_l1e(
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;
-        dprintk(XENLOG_G_WARNING,
-                "d%d: Forcing read-only access to MFN %lx\n",
-                l1e_owner->domain_id, mfn);
+#ifndef NDEBUG
+        if ( !pci_mmcfg_decode(mfn, &seg, &bdf) ||
+             ((ro_map = pci_get_ro_map(seg)) != NULL &&
+              test_bit(bdf, ro_map)) )
+            printk(XENLOG_G_WARNING
+                   "d%d: Forcing read-only access to MFN %lx\n",
+                   l1e_owner->domain_id, mfn);
+        else
+            rangeset_report_ranges(mmio_ro_ranges, 0, ~0UL,
+                                   print_mmio_emul_range,
+                                   &(struct mmio_emul_range_ctxt){
+                                      .d = l1e_owner,
+                                      .mfn = mfn });
+#endif
         return 1;
     }
 
@@ -5145,6 +5201,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
 
     /* We are looking only for read-only mappings of p.t. pages. */
     if ( ((l1e_get_flags(pte) & (_PAGE_PRESENT|_PAGE_RW)) != _PAGE_PRESENT) ||
+         rangeset_contains_singleton(mmio_ro_ranges, l1e_get_pfn(pte)) ||
          !get_page_from_pagenr(l1e_get_pfn(pte), d) )
         goto bail;
 
@@ -5192,6 +5249,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
 struct mmio_ro_emulate_ctxt {
     struct x86_emulate_ctxt ctxt;
     unsigned long cr2;
+    unsigned int seg, bdf;
 };
 
 static int mmio_ro_emulated_read(
@@ -5231,6 +5289,44 @@ static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .write      = mmio_ro_emulated_write,
 };
 
+static int mmio_intercept_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ctxt =
+        container_of(ctxt, struct mmio_ro_emulate_ctxt, ctxt);
+
+    /*
+     * Only allow naturally-aligned stores no wider than 4 bytes to the
+     * original %cr2 address.
+     */
+    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 ||
+         offset != mmio_ctxt->cr2 )
+    {
+        MEM_LOG("mmio_intercept: bad write (cr2=%lx, addr=%lx, bytes=%u)",
+                mmio_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    offset &= 0xfff;
+    pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf, offset, bytes,
+                             p_data);
+    pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
+                    PCI_DEVFN2(mmio_ctxt->bdf), offset, bytes,
+                    *(uint32_t *)p_data);
+
+    return X86EMUL_OKAY;
+}
+
+static const struct x86_emulate_ops mmio_intercept_ops = {
+    .read       = mmio_ro_emulated_read,
+    .insn_fetch = ptwr_emulated_read,
+    .write      = mmio_intercept_write,
+};
+
 /* Check if guest is trying to modify a r/o MMIO page. */
 int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
                           struct cpu_user_regs *regs)
@@ -5245,6 +5341,7 @@ int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
         .ctxt.swint_emulate = x86_swint_emulate_none,
         .cr2 = addr
     };
+    const unsigned long *ro_map;
     int rc;
 
     /* Attempt to read the PTE that maps the VA being accessed. */
@@ -5269,7 +5366,12 @@ int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
     if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
         return 0;
 
-    rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_ro_emulate_ops);
+    if ( pci_mmcfg_decode(mfn, &mmio_ro_ctxt.seg, &mmio_ro_ctxt.bdf) &&
+         ((ro_map = pci_get_ro_map(mmio_ro_ctxt.seg)) == NULL ||
+          !test_bit(mmio_ro_ctxt.bdf, ro_map)) )
+        rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_intercept_ops);
+    else
+        rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_ro_emulate_ops);
 
     return rc != X86EMUL_UNHANDLEABLE ? EXCRET_fault_fixed : 0;
 }
diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index 565e8c7..1f9a996 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -134,30 +134,10 @@ static void __iomem *mcfg_ioremap(const struct acpi_mcfg_allocation *cfg,
     return (void __iomem *) virt;
 }
 
-void arch_pci_ro_device(int seg, int bdf)
-{
-    unsigned int idx, bus = PCI_BUS(bdf);
-
-    for (idx = 0; idx < pci_mmcfg_config_num; ++idx) {
-        const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[idx].cfg;
-        unsigned long mfn = (cfg->address >> PAGE_SHIFT) + bdf;
-
-        if (!pci_mmcfg_virt[idx].virt || cfg->pci_segment != seg ||
-            cfg->start_bus_number > bus || cfg->end_bus_number < bus)
-            continue;
-
-        if (rangeset_add_singleton(mmio_ro_ranges, mfn))
-            printk(XENLOG_ERR
-                   "%04x:%02x:%02x.%u: could not mark MCFG (mfn %#lx) read-only\n",
-                   cfg->pci_segment, bus, PCI_SLOT(bdf), PCI_FUNC(bdf),
-                   mfn);
-    }
-}
-
 int pci_mmcfg_arch_enable(unsigned int idx)
 {
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
-    const unsigned long *ro_map = pci_get_ro_map(cfg->pci_segment);
+    unsigned long start_mfn, end_mfn;
 
     if (pci_mmcfg_virt[idx].virt)
         return 0;
@@ -169,16 +149,15 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     }
     printk(KERN_INFO "PCI: Using MCFG for segment %04x bus %02x-%02x\n",
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
-    if (ro_map) {
-        unsigned int bdf = PCI_BDF(cfg->start_bus_number, 0, 0);
-        unsigned int end = PCI_BDF(cfg->end_bus_number, -1, -1);
-
-        while ((bdf = find_next_bit(ro_map, end + 1, bdf)) <= end) {
-            arch_pci_ro_device(cfg->pci_segment, bdf);
-            if (bdf++ == end)
-                break;
-        }
-    }
+
+    start_mfn = PFN_DOWN(cfg->address) + PCI_BDF(cfg->start_bus_number, 0, 0);
+    end_mfn = PFN_DOWN(cfg->address) + PCI_BDF(cfg->end_bus_number, ~0, ~0);
+    if ( rangeset_add_range(mmio_ro_ranges, start_mfn, end_mfn) )
+        printk(XENLOG_ERR
+               "%04x:%02x-%02x: could not mark MCFG (mfns %lx-%lx) read-only\n",
+               cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number,
+               start_mfn, end_mfn);
+
     return 0;
 }
 
@@ -197,6 +176,28 @@ void pci_mmcfg_arch_disable(unsigned int idx)
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
 }
 
+bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                        unsigned int *bdf)
+{
+    unsigned int idx;
+
+    for (idx = 0; idx < pci_mmcfg_config_num; ++idx) {
+        const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[idx].cfg;
+
+        if (pci_mmcfg_virt[idx].virt &&
+            mfn >= PFN_DOWN(cfg->address) + PCI_BDF(cfg->start_bus_number,
+                                                    0, 0) &&
+            mfn <= PFN_DOWN(cfg->address) + PCI_BDF(cfg->end_bus_number,
+                                                    ~0, ~0)) {
+            *seg = cfg->pci_segment;
+            *bdf = mfn - PFN_DOWN(cfg->address);
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
 int __init pci_mmcfg_arch_init(void)
 {
     int i;
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index e30be43..8632265 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -447,7 +447,6 @@ int __init pci_ro_device(int seg, int bus, int devfn)
     }
 
     __set_bit(PCI_BDF2(bus, devfn), pseg->ro_map);
-    arch_pci_ro_device(seg, PCI_BDF2(bus, devfn));
     _pci_hide_device(pdev);
 
     return 0;
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index da28a90..38ace79 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -20,5 +20,7 @@ int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
                              uint32_t *data);
 int pci_msi_conf_write_intercept(struct pci_dev *, unsigned int reg,
                                  unsigned int size, uint32_t *data);
+bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                        unsigned int *bdf);
 
 #endif /* __X86_PCI_H__ */
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3908146..6ce3d00 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -110,7 +110,6 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                    const struct pci_dev_info *, nodeid_t node);
 int pci_remove_device(u16 seg, u8 bus, u8 devfn);
 int pci_ro_device(int seg, int bus, int devfn);
-void arch_pci_ro_device(int seg, int bdf);
 int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:35:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATC-00056p-5Z; Fri, 31 Jul 2015 13:35:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATA-00056Z-3g
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:28 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	95/A5-24856-F997BB55; Fri, 31 Jul 2015 13:35:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438349725!24954325!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 19655 invoked from network); 31 Jul 2015 13:35:26 -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;
	31 Jul 2015 13:35:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAT7-0004Q0-1r
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAT1-0006lv-W2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:20 +0000
Date: Fri, 31 Jul 2015 13:35:19 +0000
Message-Id: <E1ZLAT1-0006lv-W2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PCI: intercept all PV Dom0 MMCFG
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9256f66c1606cd9339412bff7fbc7bd9e8beb28c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 10:17:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 10:17:08 2015 +0200

    x86/PCI: intercept all PV Dom0 MMCFG writes
    
    ... to hook up pci_conf_write_intercept() even for Dom0 not using
    method 1 accesses for the base part of PCI device config space.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c                 |  110 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/mmconfig_64.c |   63 +++++++++++----------
 xen/drivers/passthrough/pci.c     |    1 -
 xen/include/asm-x86/pci.h         |    2 +
 xen/include/xen/pci.h             |    1 -
 5 files changed, 140 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 342414f..f316377 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -734,6 +734,46 @@ static int update_xen_mappings(unsigned long mfn, unsigned long cacheattr)
     return err;
 }
 
+#ifndef NDEBUG
+struct mmio_emul_range_ctxt {
+    const struct domain *d;
+    unsigned long mfn;
+};
+
+static int print_mmio_emul_range(unsigned long s, unsigned long e, void *arg)
+{
+    const struct mmio_emul_range_ctxt *ctxt = arg;
+
+    if ( ctxt->mfn > e )
+        return 0;
+
+    if ( ctxt->mfn >= s )
+    {
+        static DEFINE_SPINLOCK(last_lock);
+        static const struct domain *last_d;
+        static unsigned long last_s = ~0UL, last_e;
+        bool_t print = 0;
+
+        spin_lock(&last_lock);
+        if ( last_d != ctxt->d || last_s != s || last_e != e )
+        {
+            last_d = ctxt->d;
+            last_s = s;
+            last_e = e;
+            print = 1;
+        }
+        spin_unlock(&last_lock);
+
+        if ( print )
+            printk(XENLOG_G_INFO
+                   "d%d: Forcing write emulation on MFNs %lx-%lx\n",
+                   ctxt->d->domain_id, s, e);
+    }
+
+    return 1;
+}
+#endif
+
 int
 get_page_from_l1e(
     l1_pgentry_t l1e, struct domain *l1e_owner, struct domain *pg_owner)
@@ -757,6 +797,11 @@ get_page_from_l1e(
     if ( !mfn_valid(mfn) ||
          (real_pg_owner = page_get_owner_and_reference(page)) == dom_io )
     {
+#ifndef NDEBUG
+        const unsigned long *ro_map;
+        unsigned int seg, bdf;
+#endif
+
         /* Only needed the reference to confirm dom_io ownership. */
         if ( mfn_valid(mfn) )
             put_page(page);
@@ -792,9 +837,20 @@ get_page_from_l1e(
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;
-        dprintk(XENLOG_G_WARNING,
-                "d%d: Forcing read-only access to MFN %lx\n",
-                l1e_owner->domain_id, mfn);
+#ifndef NDEBUG
+        if ( !pci_mmcfg_decode(mfn, &seg, &bdf) ||
+             ((ro_map = pci_get_ro_map(seg)) != NULL &&
+              test_bit(bdf, ro_map)) )
+            printk(XENLOG_G_WARNING
+                   "d%d: Forcing read-only access to MFN %lx\n",
+                   l1e_owner->domain_id, mfn);
+        else
+            rangeset_report_ranges(mmio_ro_ranges, 0, ~0UL,
+                                   print_mmio_emul_range,
+                                   &(struct mmio_emul_range_ctxt){
+                                      .d = l1e_owner,
+                                      .mfn = mfn });
+#endif
         return 1;
     }
 
@@ -5145,6 +5201,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
 
     /* We are looking only for read-only mappings of p.t. pages. */
     if ( ((l1e_get_flags(pte) & (_PAGE_PRESENT|_PAGE_RW)) != _PAGE_PRESENT) ||
+         rangeset_contains_singleton(mmio_ro_ranges, l1e_get_pfn(pte)) ||
          !get_page_from_pagenr(l1e_get_pfn(pte), d) )
         goto bail;
 
@@ -5192,6 +5249,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
 struct mmio_ro_emulate_ctxt {
     struct x86_emulate_ctxt ctxt;
     unsigned long cr2;
+    unsigned int seg, bdf;
 };
 
 static int mmio_ro_emulated_read(
@@ -5231,6 +5289,44 @@ static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .write      = mmio_ro_emulated_write,
 };
 
+static int mmio_intercept_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ctxt =
+        container_of(ctxt, struct mmio_ro_emulate_ctxt, ctxt);
+
+    /*
+     * Only allow naturally-aligned stores no wider than 4 bytes to the
+     * original %cr2 address.
+     */
+    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 ||
+         offset != mmio_ctxt->cr2 )
+    {
+        MEM_LOG("mmio_intercept: bad write (cr2=%lx, addr=%lx, bytes=%u)",
+                mmio_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    offset &= 0xfff;
+    pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf, offset, bytes,
+                             p_data);
+    pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
+                    PCI_DEVFN2(mmio_ctxt->bdf), offset, bytes,
+                    *(uint32_t *)p_data);
+
+    return X86EMUL_OKAY;
+}
+
+static const struct x86_emulate_ops mmio_intercept_ops = {
+    .read       = mmio_ro_emulated_read,
+    .insn_fetch = ptwr_emulated_read,
+    .write      = mmio_intercept_write,
+};
+
 /* Check if guest is trying to modify a r/o MMIO page. */
 int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
                           struct cpu_user_regs *regs)
@@ -5245,6 +5341,7 @@ int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
         .ctxt.swint_emulate = x86_swint_emulate_none,
         .cr2 = addr
     };
+    const unsigned long *ro_map;
     int rc;
 
     /* Attempt to read the PTE that maps the VA being accessed. */
@@ -5269,7 +5366,12 @@ int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr,
     if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
         return 0;
 
-    rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_ro_emulate_ops);
+    if ( pci_mmcfg_decode(mfn, &mmio_ro_ctxt.seg, &mmio_ro_ctxt.bdf) &&
+         ((ro_map = pci_get_ro_map(mmio_ro_ctxt.seg)) == NULL ||
+          !test_bit(mmio_ro_ctxt.bdf, ro_map)) )
+        rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_intercept_ops);
+    else
+        rc = x86_emulate(&mmio_ro_ctxt.ctxt, &mmio_ro_emulate_ops);
 
     return rc != X86EMUL_UNHANDLEABLE ? EXCRET_fault_fixed : 0;
 }
diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index 565e8c7..1f9a996 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -134,30 +134,10 @@ static void __iomem *mcfg_ioremap(const struct acpi_mcfg_allocation *cfg,
     return (void __iomem *) virt;
 }
 
-void arch_pci_ro_device(int seg, int bdf)
-{
-    unsigned int idx, bus = PCI_BUS(bdf);
-
-    for (idx = 0; idx < pci_mmcfg_config_num; ++idx) {
-        const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[idx].cfg;
-        unsigned long mfn = (cfg->address >> PAGE_SHIFT) + bdf;
-
-        if (!pci_mmcfg_virt[idx].virt || cfg->pci_segment != seg ||
-            cfg->start_bus_number > bus || cfg->end_bus_number < bus)
-            continue;
-
-        if (rangeset_add_singleton(mmio_ro_ranges, mfn))
-            printk(XENLOG_ERR
-                   "%04x:%02x:%02x.%u: could not mark MCFG (mfn %#lx) read-only\n",
-                   cfg->pci_segment, bus, PCI_SLOT(bdf), PCI_FUNC(bdf),
-                   mfn);
-    }
-}
-
 int pci_mmcfg_arch_enable(unsigned int idx)
 {
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
-    const unsigned long *ro_map = pci_get_ro_map(cfg->pci_segment);
+    unsigned long start_mfn, end_mfn;
 
     if (pci_mmcfg_virt[idx].virt)
         return 0;
@@ -169,16 +149,15 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     }
     printk(KERN_INFO "PCI: Using MCFG for segment %04x bus %02x-%02x\n",
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
-    if (ro_map) {
-        unsigned int bdf = PCI_BDF(cfg->start_bus_number, 0, 0);
-        unsigned int end = PCI_BDF(cfg->end_bus_number, -1, -1);
-
-        while ((bdf = find_next_bit(ro_map, end + 1, bdf)) <= end) {
-            arch_pci_ro_device(cfg->pci_segment, bdf);
-            if (bdf++ == end)
-                break;
-        }
-    }
+
+    start_mfn = PFN_DOWN(cfg->address) + PCI_BDF(cfg->start_bus_number, 0, 0);
+    end_mfn = PFN_DOWN(cfg->address) + PCI_BDF(cfg->end_bus_number, ~0, ~0);
+    if ( rangeset_add_range(mmio_ro_ranges, start_mfn, end_mfn) )
+        printk(XENLOG_ERR
+               "%04x:%02x-%02x: could not mark MCFG (mfns %lx-%lx) read-only\n",
+               cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number,
+               start_mfn, end_mfn);
+
     return 0;
 }
 
@@ -197,6 +176,28 @@ void pci_mmcfg_arch_disable(unsigned int idx)
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
 }
 
+bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                        unsigned int *bdf)
+{
+    unsigned int idx;
+
+    for (idx = 0; idx < pci_mmcfg_config_num; ++idx) {
+        const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[idx].cfg;
+
+        if (pci_mmcfg_virt[idx].virt &&
+            mfn >= PFN_DOWN(cfg->address) + PCI_BDF(cfg->start_bus_number,
+                                                    0, 0) &&
+            mfn <= PFN_DOWN(cfg->address) + PCI_BDF(cfg->end_bus_number,
+                                                    ~0, ~0)) {
+            *seg = cfg->pci_segment;
+            *bdf = mfn - PFN_DOWN(cfg->address);
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
 int __init pci_mmcfg_arch_init(void)
 {
     int i;
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index e30be43..8632265 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -447,7 +447,6 @@ int __init pci_ro_device(int seg, int bus, int devfn)
     }
 
     __set_bit(PCI_BDF2(bus, devfn), pseg->ro_map);
-    arch_pci_ro_device(seg, PCI_BDF2(bus, devfn));
     _pci_hide_device(pdev);
 
     return 0;
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index da28a90..38ace79 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -20,5 +20,7 @@ int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
                              uint32_t *data);
 int pci_msi_conf_write_intercept(struct pci_dev *, unsigned int reg,
                                  unsigned int size, uint32_t *data);
+bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                        unsigned int *bdf);
 
 #endif /* __X86_PCI_H__ */
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3908146..6ce3d00 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -110,7 +110,6 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                    const struct pci_dev_info *, nodeid_t node);
 int pci_remove_device(u16 seg, u8 bus, u8 devfn);
 int pci_ro_device(int seg, int bus, int devfn);
-void arch_pci_ro_device(int seg, int bdf);
 int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:35:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATL-000581-7z; Fri, 31 Jul 2015 13:35: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 1ZLATJ-00057q-ER
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:37 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	8B/B1-10715-8A97BB55; Fri, 31 Jul 2015 13:35:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349735!30796690!1
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 9988 invoked from network); 31 Jul 2015 13:35:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:35:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATH-0004Q8-6E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATH-0006mp-4y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:35 +0000
Date: Fri, 31 Jul 2015 13:35:35 +0000
Message-Id: <E1ZLATH-0006mp-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: don't build with
	__XEN_TOOLS__ defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 742ab6ac1976ad6e3ec9f9d49fbf74aff27e6eb4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 14:03:20 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 14:03:20 2015 +0200

    hvmloader: don't build with __XEN_TOOLS__ defined
    
    This being an in-guest component, it shouldn't get to see (and even
    less so use) tools-only public interfaces.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index e4830ca..76773b8 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -31,6 +31,9 @@ SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y)
 
 CFLAGS += $(CFLAGS_xeninclude)
 
+# We mustn't use tools-only public interfaces.
+CFLAGS += -U__XEN_TOOLS__ -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
+
 OBJS  = hvmloader.o mp_tables.o util.o smbios.o 
 OBJS += smp.o cacheattr.o xenbus.o vnuma.o
 OBJS += e820.o pci.o pir.o ctype.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 Fri Jul 31 13:35:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATL-000581-7z; Fri, 31 Jul 2015 13:35: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 1ZLATJ-00057q-ER
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:37 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	8B/B1-10715-8A97BB55; Fri, 31 Jul 2015 13:35:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349735!30796690!1
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 9988 invoked from network); 31 Jul 2015 13:35:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:35:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATH-0004Q8-6E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATH-0006mp-4y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:35 +0000
Date: Fri, 31 Jul 2015 13:35:35 +0000
Message-Id: <E1ZLATH-0006mp-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: don't build with
	__XEN_TOOLS__ defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 742ab6ac1976ad6e3ec9f9d49fbf74aff27e6eb4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 14:03:20 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 14:03:20 2015 +0200

    hvmloader: don't build with __XEN_TOOLS__ defined
    
    This being an in-guest component, it shouldn't get to see (and even
    less so use) tools-only public interfaces.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index e4830ca..76773b8 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -31,6 +31,9 @@ SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y)
 
 CFLAGS += $(CFLAGS_xeninclude)
 
+# We mustn't use tools-only public interfaces.
+CFLAGS += -U__XEN_TOOLS__ -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
+
 OBJS  = hvmloader.o mp_tables.o util.o smbios.o 
 OBJS += smp.o cacheattr.o xenbus.o vnuma.o
 OBJS += e820.o pci.o pir.o ctype.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 Fri Jul 31 13:35:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATU-00059D-AR; Fri, 31 Jul 2015 13:35:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATT-000593-L0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:47 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	9F/74-16618-3B97BB55; Fri, 31 Jul 2015 13:35:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438349745!25487194!1
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 8972 invoked from network); 31 Jul 2015 13:35:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:35:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATR-0004QG-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATR-0006nH-Ai
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:45 +0000
Date: Fri, 31 Jul 2015 13:35:45 +0000
Message-Id: <E1ZLATR-0006nH-Ai@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: drop bogus NULL check from
	pci_restore_msi_state()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10f086ecbb2a4f9749e22412020e964a19c1b7fd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 14:03:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 14:03:41 2015 +0200

    x86/MSI: drop bogus NULL check from pci_restore_msi_state()
    
    Commit 372900faf8 ("x86/MSI-X: reduce fiddling with control register
    during restore") introduced de-references of pdev before it gets
    checked against NULL. Instead of deferring the de-references, drop
    the pointless check - both call sites do that check already.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index fa95048..e71e19f 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1354,9 +1354,6 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if ( !use_msi )
         return -EOPNOTSUPP;
 
-    if ( !pdev )
-        return -EINVAL;
-
     ret = xsm_resource_setup_pci(XSM_PRIV,
                                 (pdev->seg << 16) | (pdev->bus << 8) |
                                 pdev->devfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:35:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATU-00059D-AR; Fri, 31 Jul 2015 13:35:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATT-000593-L0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:47 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	9F/74-16618-3B97BB55; Fri, 31 Jul 2015 13:35:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438349745!25487194!1
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 8972 invoked from network); 31 Jul 2015 13:35:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:35:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATR-0004QG-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATR-0006nH-Ai
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:45 +0000
Date: Fri, 31 Jul 2015 13:35:45 +0000
Message-Id: <E1ZLATR-0006nH-Ai@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: drop bogus NULL check from
	pci_restore_msi_state()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10f086ecbb2a4f9749e22412020e964a19c1b7fd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 23 14:03:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 23 14:03:41 2015 +0200

    x86/MSI: drop bogus NULL check from pci_restore_msi_state()
    
    Commit 372900faf8 ("x86/MSI-X: reduce fiddling with control register
    during restore") introduced de-references of pdev before it gets
    checked against NULL. Instead of deferring the de-references, drop
    the pointless check - both call sites do that check already.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index fa95048..e71e19f 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1354,9 +1354,6 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if ( !use_msi )
         return -EOPNOTSUPP;
 
-    if ( !pdev )
-        return -EINVAL;
-
     ret = xsm_resource_setup_pci(XSM_PRIV,
                                 (pdev->seg << 16) | (pdev->bus << 8) |
                                 pdev->devfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:35:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATf-0005B3-FN; Fri, 31 Jul 2015 13:35:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATe-0005Ax-In
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:58 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	7D/33-14422-DB97BB55; Fri, 31 Jul 2015 13:35:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1438349755!24962282!1
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 1577 invoked from network); 31 Jul 2015 13:35:56 -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;
	31 Jul 2015 13:35:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATb-0004QO-Iq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATb-0006ng-G5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:55 +0000
Date: Fri, 31 Jul 2015 13:35:55 +0000
Message-Id: <E1ZLATb-0006ng-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce
	XENMEM_reserved_device_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 9568438113277ea73cf5c9dbc426929f2c61c31f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 22 16:06:01 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    introduce XENMEM_reserved_device_memory_map
    
    This is a prerequisite for punching holes into HVM and PVH guests' P2M
    to allow passing through devices that are associated with (on VT-d)
    RMRRs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    ---
    v12a: Move interface structure union member to the end, while moving
         the whole public header block into a __XEN__ / __XEN_TOOLS__
         conditional block.
    v12: Restore changes as much as possible to my original version, fixing
         a few issues that got introduced after handing it over. Unionize
         new public memop interface structure to allow for non-PCI to be
         supported later on. Check flags to have all currently undefined
         flags clear. Refine adjustments to xen/pci.h.
---
 xen/common/compat/memory.c           |   65 ++++++++++++++++++++++++++++++++++
 xen/common/memory.c                  |   62 ++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/iommu.c      |   10 +++++
 xen/drivers/passthrough/vtd/dmar.c   |   27 ++++++++++++++
 xen/drivers/passthrough/vtd/extern.h |    1 +
 xen/drivers/passthrough/vtd/iommu.c  |    1 +
 xen/include/public/memory.h          |   37 +++++++++++++++++++-
 xen/include/xen/iommu.h              |   10 +++++
 xen/include/xen/pci.h                |    4 ++
 xen/include/xlat.lst                 |    3 +-
 10 files changed, 218 insertions(+), 2 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index b258138..002948b 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -17,6 +17,42 @@ CHECK_TYPE(domid);
 CHECK_mem_access_op;
 CHECK_vmemrange;
 
+#ifdef HAS_PASSTHROUGH
+struct get_reserved_device_memory {
+    struct compat_reserved_device_memory_map map;
+    unsigned int used_entries;
+};
+
+static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr,
+                                      u32 id, void *ctxt)
+{
+    struct get_reserved_device_memory *grdm = ctxt;
+    u32 sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus,
+                         grdm->map.dev.pci.devfn);
+
+    if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) )
+        return 0;
+
+    if ( grdm->used_entries < grdm->map.nr_entries )
+    {
+        struct compat_reserved_device_memory rdm = {
+            .start_pfn = start, .nr_pages = nr
+        };
+
+        if ( rdm.start_pfn != start || rdm.nr_pages != nr )
+            return -ERANGE;
+
+        if ( __copy_to_compat_offset(grdm->map.buffer, grdm->used_entries,
+                                     &rdm, 1) )
+            return -EFAULT;
+    }
+
+    ++grdm->used_entries;
+
+    return 1;
+}
+#endif
+
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
     int split, op = cmd & MEMOP_CMD_MASK;
@@ -303,6 +339,35 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+#ifdef HAS_PASSTHROUGH
+        case XENMEM_reserved_device_memory_map:
+        {
+            struct get_reserved_device_memory grdm;
+
+            if ( unlikely(start_extent) )
+                return -ENOSYS;
+
+            if ( copy_from_guest(&grdm.map, compat, 1) ||
+                 !compat_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
+                return -EFAULT;
+
+            if ( grdm.map.flags & ~XENMEM_RDM_ALL )
+                return -EINVAL;
+
+            grdm.used_entries = 0;
+            rc = iommu_get_reserved_device_memory(get_reserved_device_memory,
+                                                  &grdm);
+
+            if ( !rc && grdm.map.nr_entries < grdm.used_entries )
+                rc = -ENOBUFS;
+            grdm.map.nr_entries = grdm.used_entries;
+            if ( __copy_to_guest(compat, &grdm.map, 1) )
+                rc = -EFAULT;
+
+            return rc;
+        }
+#endif
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e5d49d8..61bb94c 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -748,6 +748,39 @@ static int construct_memop_from_reservation(
     return 0;
 }
 
+#ifdef HAS_PASSTHROUGH
+struct get_reserved_device_memory {
+    struct xen_reserved_device_memory_map map;
+    unsigned int used_entries;
+};
+
+static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr,
+                                      u32 id, void *ctxt)
+{
+    struct get_reserved_device_memory *grdm = ctxt;
+    u32 sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus,
+                         grdm->map.dev.pci.devfn);
+
+    if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) )
+        return 0;
+
+    if ( grdm->used_entries < grdm->map.nr_entries )
+    {
+        struct xen_reserved_device_memory rdm = {
+            .start_pfn = start, .nr_pages = nr
+        };
+
+        if ( __copy_to_guest_offset(grdm->map.buffer, grdm->used_entries,
+                                    &rdm, 1) )
+            return -EFAULT;
+    }
+
+    ++grdm->used_entries;
+
+    return 1;
+}
+#endif
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -1162,6 +1195,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+#ifdef HAS_PASSTHROUGH
+    case XENMEM_reserved_device_memory_map:
+    {
+        struct get_reserved_device_memory grdm;
+
+        if ( unlikely(start_extent) )
+            return -ENOSYS;
+
+        if ( copy_from_guest(&grdm.map, arg, 1) ||
+             !guest_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
+            return -EFAULT;
+
+        if ( grdm.map.flags & ~XENMEM_RDM_ALL )
+            return -EINVAL;
+
+        grdm.used_entries = 0;
+        rc = iommu_get_reserved_device_memory(get_reserved_device_memory,
+                                              &grdm);
+
+        if ( !rc && grdm.map.nr_entries < grdm.used_entries )
+            rc = -ENOBUFS;
+        grdm.map.nr_entries = grdm.used_entries;
+        if ( __copy_to_guest(arg, &grdm.map, 1) )
+            rc = -EFAULT;
+
+        break;
+    }
+#endif
+
     default:
         rc = arch_memory_op(cmd, arg);
         break;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 06cb38f..0b2ef52 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -375,6 +375,16 @@ void iommu_crash_shutdown(void)
     iommu_enabled = iommu_intremap = 0;
 }
 
+int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+
+    if ( !iommu_enabled || !ops->get_reserved_device_memory )
+        return 0;
+
+    return ops->get_reserved_device_memory(func, ctxt);
+}
+
 bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature)
 {
     const struct hvm_iommu *hd = domain_hvm_iommu(d);
diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 2672688..56daac7 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -914,3 +914,30 @@ int platform_supports_x2apic(void)
     unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
     return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
+
+int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
+{
+    struct acpi_rmrr_unit *rmrr, *rmrr_cur = NULL;
+    unsigned int i;
+    u16 bdf;
+
+    for_each_rmrr_device ( rmrr, bdf, i )
+    {
+        int rc;
+
+        if ( rmrr == rmrr_cur )
+            continue;
+
+        rc = func(PFN_DOWN(rmrr->base_address),
+                  PFN_UP(rmrr->end_address) - PFN_DOWN(rmrr->base_address),
+                  PCI_SBDF2(rmrr->segment, bdf), ctxt);
+
+        if ( unlikely(rc < 0) )
+            return rc;
+
+        if ( rc )
+            rmrr_cur = rmrr;
+    }
+
+    return 0;
+}
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 5524dba..f9ee9b0 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -75,6 +75,7 @@ int domain_context_mapping_one(struct domain *domain, struct iommu *iommu,
                                u8 bus, u8 devfn, const struct pci_dev *);
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
+int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt);
 
 unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
 void io_apic_write_remap_rte(unsigned int apic,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a88b5a3..9849d0e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2490,6 +2490,7 @@ const struct iommu_ops intel_iommu_ops = {
     .crash_shutdown = vtd_crash_shutdown,
     .iotlb_flush = intel_iommu_iotlb_flush,
     .iotlb_flush_all = intel_iommu_iotlb_flush_all,
+    .get_reserved_device_memory = intel_iommu_get_reserved_device_memory,
     .dump_p2m_table = vtd_dump_p2m_table,
 };
 
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 832559a..320de91 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -28,6 +28,7 @@
 #define __XEN_PUBLIC_MEMORY_H__
 
 #include "xen.h"
+#include "physdev.h"
 
 /*
  * Increase or decrease the specified domain's memory reservation. Returns the
@@ -522,6 +523,40 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
+/*
+ * With some legacy devices, certain guest-physical addresses cannot safely
+ * be used for other purposes, e.g. to map guest RAM.  This hypercall
+ * enumerates those regions so the toolstack can avoid using them.
+ */
+#define XENMEM_reserved_device_memory_map   27
+struct xen_reserved_device_memory {
+    xen_pfn_t start_pfn;
+    xen_ulong_t nr_pages;
+};
+typedef struct xen_reserved_device_memory xen_reserved_device_memory_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_t);
+
+struct xen_reserved_device_memory_map {
+#define XENMEM_RDM_ALL 1 /* Request all regions (ignore dev union). */
+    /* IN */
+    uint32_t flags;
+    /*
+     * IN/OUT
+     *
+     * Gets set to the required number of entries when too low,
+     * signaled by error code -ERANGE.
+     */
+    unsigned int nr_entries;
+    /* OUT */
+    XEN_GUEST_HANDLE(xen_reserved_device_memory_t) buffer;
+    /* IN */
+    union {
+        struct physdev_pci_device pci;
+    } dev;
+};
+typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 /*
@@ -573,7 +608,7 @@ struct xen_vnuma_topology_info {
 typedef struct xen_vnuma_topology_info xen_vnuma_topology_info_t;
 DEFINE_XEN_GUEST_HANDLE(xen_vnuma_topology_info_t);
 
-/* Next available subop number is 27 */
+/* Next available subop number is 28 */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 1d00696..52ed3b7 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -125,6 +125,14 @@ int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
 
 struct page_info;
 
+/*
+ * Any non-zero value returned from callbacks of this type will cause the
+ * function the callback was handed to terminate its iteration. Assigning
+ * meaning of these non-zero values is left to the top level caller /
+ * callback pair.
+ */
+typedef int iommu_grdm_t(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctxt);
+
 struct iommu_ops {
     int (*init)(struct domain *d);
     void (*hwdom_init)(struct domain *d);
@@ -156,12 +164,14 @@ struct iommu_ops {
     void (*crash_shutdown)(void);
     void (*iotlb_flush)(struct domain *d, unsigned long gfn, unsigned int page_count);
     void (*iotlb_flush_all)(struct domain *d);
+    int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
     void (*dump_p2m_table)(struct domain *d);
 };
 
 void iommu_suspend(void);
 void iommu_resume(void);
 void iommu_crash_shutdown(void);
+int iommu_get_reserved_device_memory(iommu_grdm_t *, void *);
 
 void iommu_share_p2m_table(struct domain *d);
 
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 6ce3d00..a5aef55 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -26,6 +26,7 @@
  *  7:3 = slot
  *  2:0 = function
  */
+#define PCI_SEG(sbdf) (((sbdf) >> 16) & 0xffff)
 #define PCI_BUS(bdf)    (((bdf) >> 8) & 0xff)
 #define PCI_SLOT(bdf)   (((bdf) >> 3) & 0x1f)
 #define PCI_FUNC(bdf)   ((bdf) & 0x07)
@@ -33,6 +34,9 @@
 #define PCI_DEVFN2(bdf) ((bdf) & 0xff)
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
+#define PCI_SBDF(s,b,d,f) ((((s) & 0xffff) << 16) | PCI_BDF(b,d,f))
+#define PCI_SBDF2(s,bdf) ((((s) & 0xffff) << 16) | ((bdf) & 0xffff))
+#define PCI_SBDF3(s,b,df) ((((s) & 0xffff) << 16) | PCI_BDF2(b, df))
 
 struct pci_dev_info {
     bool_t is_extfn;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 6fb15bf..8cedee7 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -65,9 +65,10 @@
 !	memory_exchange			memory.h
 !	memory_map			memory.h
 !	memory_reservation		memory.h
-?	mem_access_op		memory.h
+?	mem_access_op			memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+!	reserved_device_memory_map	memory.h
 ?	vmemrange			memory.h
 !	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.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 Fri Jul 31 13:35:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:35: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 1ZLATf-0005B3-FN; Fri, 31 Jul 2015 13:35:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATe-0005Ax-In
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:58 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	7D/33-14422-DB97BB55; Fri, 31 Jul 2015 13:35:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1438349755!24962282!1
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 1577 invoked from network); 31 Jul 2015 13:35:56 -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;
	31 Jul 2015 13:35:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATb-0004QO-Iq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATb-0006ng-G5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:35:55 +0000
Date: Fri, 31 Jul 2015 13:35:55 +0000
Message-Id: <E1ZLATb-0006ng-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce
	XENMEM_reserved_device_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 9568438113277ea73cf5c9dbc426929f2c61c31f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 22 16:06:01 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    introduce XENMEM_reserved_device_memory_map
    
    This is a prerequisite for punching holes into HVM and PVH guests' P2M
    to allow passing through devices that are associated with (on VT-d)
    RMRRs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    ---
    v12a: Move interface structure union member to the end, while moving
         the whole public header block into a __XEN__ / __XEN_TOOLS__
         conditional block.
    v12: Restore changes as much as possible to my original version, fixing
         a few issues that got introduced after handing it over. Unionize
         new public memop interface structure to allow for non-PCI to be
         supported later on. Check flags to have all currently undefined
         flags clear. Refine adjustments to xen/pci.h.
---
 xen/common/compat/memory.c           |   65 ++++++++++++++++++++++++++++++++++
 xen/common/memory.c                  |   62 ++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/iommu.c      |   10 +++++
 xen/drivers/passthrough/vtd/dmar.c   |   27 ++++++++++++++
 xen/drivers/passthrough/vtd/extern.h |    1 +
 xen/drivers/passthrough/vtd/iommu.c  |    1 +
 xen/include/public/memory.h          |   37 +++++++++++++++++++-
 xen/include/xen/iommu.h              |   10 +++++
 xen/include/xen/pci.h                |    4 ++
 xen/include/xlat.lst                 |    3 +-
 10 files changed, 218 insertions(+), 2 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index b258138..002948b 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -17,6 +17,42 @@ CHECK_TYPE(domid);
 CHECK_mem_access_op;
 CHECK_vmemrange;
 
+#ifdef HAS_PASSTHROUGH
+struct get_reserved_device_memory {
+    struct compat_reserved_device_memory_map map;
+    unsigned int used_entries;
+};
+
+static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr,
+                                      u32 id, void *ctxt)
+{
+    struct get_reserved_device_memory *grdm = ctxt;
+    u32 sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus,
+                         grdm->map.dev.pci.devfn);
+
+    if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) )
+        return 0;
+
+    if ( grdm->used_entries < grdm->map.nr_entries )
+    {
+        struct compat_reserved_device_memory rdm = {
+            .start_pfn = start, .nr_pages = nr
+        };
+
+        if ( rdm.start_pfn != start || rdm.nr_pages != nr )
+            return -ERANGE;
+
+        if ( __copy_to_compat_offset(grdm->map.buffer, grdm->used_entries,
+                                     &rdm, 1) )
+            return -EFAULT;
+    }
+
+    ++grdm->used_entries;
+
+    return 1;
+}
+#endif
+
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
     int split, op = cmd & MEMOP_CMD_MASK;
@@ -303,6 +339,35 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+#ifdef HAS_PASSTHROUGH
+        case XENMEM_reserved_device_memory_map:
+        {
+            struct get_reserved_device_memory grdm;
+
+            if ( unlikely(start_extent) )
+                return -ENOSYS;
+
+            if ( copy_from_guest(&grdm.map, compat, 1) ||
+                 !compat_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
+                return -EFAULT;
+
+            if ( grdm.map.flags & ~XENMEM_RDM_ALL )
+                return -EINVAL;
+
+            grdm.used_entries = 0;
+            rc = iommu_get_reserved_device_memory(get_reserved_device_memory,
+                                                  &grdm);
+
+            if ( !rc && grdm.map.nr_entries < grdm.used_entries )
+                rc = -ENOBUFS;
+            grdm.map.nr_entries = grdm.used_entries;
+            if ( __copy_to_guest(compat, &grdm.map, 1) )
+                rc = -EFAULT;
+
+            return rc;
+        }
+#endif
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e5d49d8..61bb94c 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -748,6 +748,39 @@ static int construct_memop_from_reservation(
     return 0;
 }
 
+#ifdef HAS_PASSTHROUGH
+struct get_reserved_device_memory {
+    struct xen_reserved_device_memory_map map;
+    unsigned int used_entries;
+};
+
+static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr,
+                                      u32 id, void *ctxt)
+{
+    struct get_reserved_device_memory *grdm = ctxt;
+    u32 sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus,
+                         grdm->map.dev.pci.devfn);
+
+    if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) )
+        return 0;
+
+    if ( grdm->used_entries < grdm->map.nr_entries )
+    {
+        struct xen_reserved_device_memory rdm = {
+            .start_pfn = start, .nr_pages = nr
+        };
+
+        if ( __copy_to_guest_offset(grdm->map.buffer, grdm->used_entries,
+                                    &rdm, 1) )
+            return -EFAULT;
+    }
+
+    ++grdm->used_entries;
+
+    return 1;
+}
+#endif
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -1162,6 +1195,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+#ifdef HAS_PASSTHROUGH
+    case XENMEM_reserved_device_memory_map:
+    {
+        struct get_reserved_device_memory grdm;
+
+        if ( unlikely(start_extent) )
+            return -ENOSYS;
+
+        if ( copy_from_guest(&grdm.map, arg, 1) ||
+             !guest_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
+            return -EFAULT;
+
+        if ( grdm.map.flags & ~XENMEM_RDM_ALL )
+            return -EINVAL;
+
+        grdm.used_entries = 0;
+        rc = iommu_get_reserved_device_memory(get_reserved_device_memory,
+                                              &grdm);
+
+        if ( !rc && grdm.map.nr_entries < grdm.used_entries )
+            rc = -ENOBUFS;
+        grdm.map.nr_entries = grdm.used_entries;
+        if ( __copy_to_guest(arg, &grdm.map, 1) )
+            rc = -EFAULT;
+
+        break;
+    }
+#endif
+
     default:
         rc = arch_memory_op(cmd, arg);
         break;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 06cb38f..0b2ef52 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -375,6 +375,16 @@ void iommu_crash_shutdown(void)
     iommu_enabled = iommu_intremap = 0;
 }
 
+int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+
+    if ( !iommu_enabled || !ops->get_reserved_device_memory )
+        return 0;
+
+    return ops->get_reserved_device_memory(func, ctxt);
+}
+
 bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature)
 {
     const struct hvm_iommu *hd = domain_hvm_iommu(d);
diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 2672688..56daac7 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -914,3 +914,30 @@ int platform_supports_x2apic(void)
     unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
     return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
+
+int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
+{
+    struct acpi_rmrr_unit *rmrr, *rmrr_cur = NULL;
+    unsigned int i;
+    u16 bdf;
+
+    for_each_rmrr_device ( rmrr, bdf, i )
+    {
+        int rc;
+
+        if ( rmrr == rmrr_cur )
+            continue;
+
+        rc = func(PFN_DOWN(rmrr->base_address),
+                  PFN_UP(rmrr->end_address) - PFN_DOWN(rmrr->base_address),
+                  PCI_SBDF2(rmrr->segment, bdf), ctxt);
+
+        if ( unlikely(rc < 0) )
+            return rc;
+
+        if ( rc )
+            rmrr_cur = rmrr;
+    }
+
+    return 0;
+}
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 5524dba..f9ee9b0 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -75,6 +75,7 @@ int domain_context_mapping_one(struct domain *domain, struct iommu *iommu,
                                u8 bus, u8 devfn, const struct pci_dev *);
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
+int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt);
 
 unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
 void io_apic_write_remap_rte(unsigned int apic,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a88b5a3..9849d0e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2490,6 +2490,7 @@ const struct iommu_ops intel_iommu_ops = {
     .crash_shutdown = vtd_crash_shutdown,
     .iotlb_flush = intel_iommu_iotlb_flush,
     .iotlb_flush_all = intel_iommu_iotlb_flush_all,
+    .get_reserved_device_memory = intel_iommu_get_reserved_device_memory,
     .dump_p2m_table = vtd_dump_p2m_table,
 };
 
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 832559a..320de91 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -28,6 +28,7 @@
 #define __XEN_PUBLIC_MEMORY_H__
 
 #include "xen.h"
+#include "physdev.h"
 
 /*
  * Increase or decrease the specified domain's memory reservation. Returns the
@@ -522,6 +523,40 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
+/*
+ * With some legacy devices, certain guest-physical addresses cannot safely
+ * be used for other purposes, e.g. to map guest RAM.  This hypercall
+ * enumerates those regions so the toolstack can avoid using them.
+ */
+#define XENMEM_reserved_device_memory_map   27
+struct xen_reserved_device_memory {
+    xen_pfn_t start_pfn;
+    xen_ulong_t nr_pages;
+};
+typedef struct xen_reserved_device_memory xen_reserved_device_memory_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_t);
+
+struct xen_reserved_device_memory_map {
+#define XENMEM_RDM_ALL 1 /* Request all regions (ignore dev union). */
+    /* IN */
+    uint32_t flags;
+    /*
+     * IN/OUT
+     *
+     * Gets set to the required number of entries when too low,
+     * signaled by error code -ERANGE.
+     */
+    unsigned int nr_entries;
+    /* OUT */
+    XEN_GUEST_HANDLE(xen_reserved_device_memory_t) buffer;
+    /* IN */
+    union {
+        struct physdev_pci_device pci;
+    } dev;
+};
+typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 /*
@@ -573,7 +608,7 @@ struct xen_vnuma_topology_info {
 typedef struct xen_vnuma_topology_info xen_vnuma_topology_info_t;
 DEFINE_XEN_GUEST_HANDLE(xen_vnuma_topology_info_t);
 
-/* Next available subop number is 27 */
+/* Next available subop number is 28 */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 1d00696..52ed3b7 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -125,6 +125,14 @@ int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
 
 struct page_info;
 
+/*
+ * Any non-zero value returned from callbacks of this type will cause the
+ * function the callback was handed to terminate its iteration. Assigning
+ * meaning of these non-zero values is left to the top level caller /
+ * callback pair.
+ */
+typedef int iommu_grdm_t(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctxt);
+
 struct iommu_ops {
     int (*init)(struct domain *d);
     void (*hwdom_init)(struct domain *d);
@@ -156,12 +164,14 @@ struct iommu_ops {
     void (*crash_shutdown)(void);
     void (*iotlb_flush)(struct domain *d, unsigned long gfn, unsigned int page_count);
     void (*iotlb_flush_all)(struct domain *d);
+    int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
     void (*dump_p2m_table)(struct domain *d);
 };
 
 void iommu_suspend(void);
 void iommu_resume(void);
 void iommu_crash_shutdown(void);
+int iommu_get_reserved_device_memory(iommu_grdm_t *, void *);
 
 void iommu_share_p2m_table(struct domain *d);
 
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 6ce3d00..a5aef55 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -26,6 +26,7 @@
  *  7:3 = slot
  *  2:0 = function
  */
+#define PCI_SEG(sbdf) (((sbdf) >> 16) & 0xffff)
 #define PCI_BUS(bdf)    (((bdf) >> 8) & 0xff)
 #define PCI_SLOT(bdf)   (((bdf) >> 3) & 0x1f)
 #define PCI_FUNC(bdf)   ((bdf) & 0x07)
@@ -33,6 +34,9 @@
 #define PCI_DEVFN2(bdf) ((bdf) & 0xff)
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
+#define PCI_SBDF(s,b,d,f) ((((s) & 0xffff) << 16) | PCI_BDF(b,d,f))
+#define PCI_SBDF2(s,bdf) ((((s) & 0xffff) << 16) | ((bdf) & 0xffff))
+#define PCI_SBDF3(s,b,df) ((((s) & 0xffff) << 16) | PCI_BDF2(b, df))
 
 struct pci_dev_info {
     bool_t is_extfn;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 6fb15bf..8cedee7 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -65,9 +65,10 @@
 !	memory_exchange			memory.h
 !	memory_map			memory.h
 !	memory_reservation		memory.h
-?	mem_access_op		memory.h
+?	mem_access_op			memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+!	reserved_device_memory_map	memory.h
 ?	vmemrange			memory.h
 !	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.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 Fri Jul 31 13:36:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLATp-0005CV-Hx; Fri, 31 Jul 2015 13:36: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 1ZLATo-0005CK-Sn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:09 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	0C/04-13905-8C97BB55; Fri, 31 Jul 2015 13:36:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438349766!9258751!1
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 9779 invoked from network); 31 Jul 2015 13:36:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:36:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATl-0004Qw-QB
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATl-0006oJ-Mj
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:05 +0000
Date: Fri, 31 Jul 2015 13:36:05 +0000
Message-Id: <E1ZLATl-0006oJ-Mj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: create RMRR mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ae03990c120a7b3067a52d9784c9aa72c0705a6
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen/vtd: create RMRR mapping
    
    RMRR reserved regions must be setup in the pfn space with an identity
    mapping to reported mfn. However existing code has problem to setup
    correct mapping when VT-d shares EPT page table, so lead to problem
    when assigning devices (e.g GPU) with RMRR reported. So instead, this
    patch aims to setup identity mapping in p2m layer, regardless of
    whether EPT is shared or not. And we still keep creating VT-d table.
    
    And we also need to introduce a pair of helper to create/clear this
    sort of identity mapping as follows:
    
    set_identity_p2m_entry():
    
    If the gfn space is unoccupied, we just set the mapping. If space
    is already occupied by desired identity mapping, do nothing.
    Otherwise, failure is returned.
    
    clear_identity_p2m_entry():
    
    We just define macro to wrapper guest_physmap_remove_page() with
    a returning value as necessary.
    
    CC: Tim Deegan <tim@xen.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 xen/arch/x86/mm/p2m.c               |   40 +++++++++++++++++++++++++++++++++-
 xen/drivers/passthrough/vtd/iommu.c |    5 +--
 xen/include/asm-x86/p2m.h           |   13 ++++++++--
 3 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6fe6387..1e763dc 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -584,14 +584,16 @@ p2m_remove_page(struct p2m_domain *p2m, unsigned long gfn, unsigned long mfn,
                          p2m->default_access);
 }
 
-void
+int
 guest_physmap_remove_page(struct domain *d, unsigned long gfn,
                           unsigned long mfn, unsigned int page_order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int rc;
     gfn_lock(p2m, gfn, page_order);
-    p2m_remove_page(p2m, gfn, mfn, page_order);
+    rc = p2m_remove_page(p2m, gfn, mfn, page_order);
     gfn_unlock(p2m, gfn, page_order);
+    return rc;
 }
 
 int
@@ -898,6 +900,40 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
     return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct, access);
 }
 
+int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
+                           p2m_access_t p2ma)
+{
+    p2m_type_t p2mt;
+    p2m_access_t a;
+    mfn_t mfn;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int ret;
+
+    if ( !paging_mode_translate(p2m->domain) )
+        return 0;
+
+    gfn_lock(p2m, gfn, 0);
+
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+
+    if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm )
+        ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
+                            p2m_mmio_direct, p2ma);
+    else if ( mfn_x(mfn) == gfn && p2mt == p2m_mmio_direct && a == p2ma )
+        ret = 0;
+    else
+    {
+        ret = -EBUSY;
+        printk(XENLOG_G_WARNING
+               "Cannot setup identity map d%d:%lx,"
+               " gfn already mapped to %lx.\n",
+               d->domain_id, gfn, mfn_x(mfn));
+    }
+
+    gfn_unlock(p2m, gfn, 0);
+    return ret;
+}
+
 /* Returns: 0 for success, -errno for failure */
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
 {
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9849d0e..5aa482f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1839,7 +1839,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
             while ( base_pfn < end_pfn )
             {
-                if ( intel_iommu_unmap_page(d, base_pfn) )
+                if ( clear_identity_p2m_entry(d, base_pfn, 0) )
                     ret = -ENXIO;
                 base_pfn++;
             }
@@ -1855,8 +1855,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
     while ( base_pfn < end_pfn )
     {
-        int err = intel_iommu_map_page(d, base_pfn, base_pfn,
-                                       IOMMUF_readable|IOMMUF_writable);
+        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw);
 
         if ( err )
             return err;
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b49c09b..190a286 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -503,9 +503,9 @@ static inline int guest_physmap_add_page(struct domain *d,
 }
 
 /* Remove a page from a domain's p2m table */
-void guest_physmap_remove_page(struct domain *d,
-                               unsigned long gfn,
-                               unsigned long mfn, unsigned int page_order);
+int guest_physmap_remove_page(struct domain *d,
+                              unsigned long gfn,
+                              unsigned long mfn, unsigned int page_order);
 
 /* Set a p2m range as populate-on-demand */
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
@@ -543,6 +543,13 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
                        p2m_access_t access);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
+/* Set identity addresses in the p2m table (for pass-through) */
+int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
+                           p2m_access_t p2ma);
+
+#define clear_identity_p2m_entry(d, gfn, page_order) \
+                        guest_physmap_remove_page(d, gfn, gfn, page_order)
+
 /* Add foreign mapping to the guest's p2m table. */
 int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
                     unsigned long gpfn, domid_t foreign_domid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:36:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLATp-0005CV-Hx; Fri, 31 Jul 2015 13:36: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 1ZLATo-0005CK-Sn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:09 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	0C/04-13905-8C97BB55; Fri, 31 Jul 2015 13:36:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438349766!9258751!1
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 9779 invoked from network); 31 Jul 2015 13:36:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:36:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATl-0004Qw-QB
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATl-0006oJ-Mj
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:05 +0000
Date: Fri, 31 Jul 2015 13:36:05 +0000
Message-Id: <E1ZLATl-0006oJ-Mj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: create RMRR mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ae03990c120a7b3067a52d9784c9aa72c0705a6
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen/vtd: create RMRR mapping
    
    RMRR reserved regions must be setup in the pfn space with an identity
    mapping to reported mfn. However existing code has problem to setup
    correct mapping when VT-d shares EPT page table, so lead to problem
    when assigning devices (e.g GPU) with RMRR reported. So instead, this
    patch aims to setup identity mapping in p2m layer, regardless of
    whether EPT is shared or not. And we still keep creating VT-d table.
    
    And we also need to introduce a pair of helper to create/clear this
    sort of identity mapping as follows:
    
    set_identity_p2m_entry():
    
    If the gfn space is unoccupied, we just set the mapping. If space
    is already occupied by desired identity mapping, do nothing.
    Otherwise, failure is returned.
    
    clear_identity_p2m_entry():
    
    We just define macro to wrapper guest_physmap_remove_page() with
    a returning value as necessary.
    
    CC: Tim Deegan <tim@xen.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 xen/arch/x86/mm/p2m.c               |   40 +++++++++++++++++++++++++++++++++-
 xen/drivers/passthrough/vtd/iommu.c |    5 +--
 xen/include/asm-x86/p2m.h           |   13 ++++++++--
 3 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6fe6387..1e763dc 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -584,14 +584,16 @@ p2m_remove_page(struct p2m_domain *p2m, unsigned long gfn, unsigned long mfn,
                          p2m->default_access);
 }
 
-void
+int
 guest_physmap_remove_page(struct domain *d, unsigned long gfn,
                           unsigned long mfn, unsigned int page_order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int rc;
     gfn_lock(p2m, gfn, page_order);
-    p2m_remove_page(p2m, gfn, mfn, page_order);
+    rc = p2m_remove_page(p2m, gfn, mfn, page_order);
     gfn_unlock(p2m, gfn, page_order);
+    return rc;
 }
 
 int
@@ -898,6 +900,40 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
     return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct, access);
 }
 
+int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
+                           p2m_access_t p2ma)
+{
+    p2m_type_t p2mt;
+    p2m_access_t a;
+    mfn_t mfn;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int ret;
+
+    if ( !paging_mode_translate(p2m->domain) )
+        return 0;
+
+    gfn_lock(p2m, gfn, 0);
+
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+
+    if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm )
+        ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
+                            p2m_mmio_direct, p2ma);
+    else if ( mfn_x(mfn) == gfn && p2mt == p2m_mmio_direct && a == p2ma )
+        ret = 0;
+    else
+    {
+        ret = -EBUSY;
+        printk(XENLOG_G_WARNING
+               "Cannot setup identity map d%d:%lx,"
+               " gfn already mapped to %lx.\n",
+               d->domain_id, gfn, mfn_x(mfn));
+    }
+
+    gfn_unlock(p2m, gfn, 0);
+    return ret;
+}
+
 /* Returns: 0 for success, -errno for failure */
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
 {
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9849d0e..5aa482f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1839,7 +1839,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
             while ( base_pfn < end_pfn )
             {
-                if ( intel_iommu_unmap_page(d, base_pfn) )
+                if ( clear_identity_p2m_entry(d, base_pfn, 0) )
                     ret = -ENXIO;
                 base_pfn++;
             }
@@ -1855,8 +1855,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
     while ( base_pfn < end_pfn )
     {
-        int err = intel_iommu_map_page(d, base_pfn, base_pfn,
-                                       IOMMUF_readable|IOMMUF_writable);
+        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw);
 
         if ( err )
             return err;
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b49c09b..190a286 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -503,9 +503,9 @@ static inline int guest_physmap_add_page(struct domain *d,
 }
 
 /* Remove a page from a domain's p2m table */
-void guest_physmap_remove_page(struct domain *d,
-                               unsigned long gfn,
-                               unsigned long mfn, unsigned int page_order);
+int guest_physmap_remove_page(struct domain *d,
+                              unsigned long gfn,
+                              unsigned long mfn, unsigned int page_order);
 
 /* Set a p2m range as populate-on-demand */
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
@@ -543,6 +543,13 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
                        p2m_access_t access);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
+/* Set identity addresses in the p2m table (for pass-through) */
+int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
+                           p2m_access_t p2ma);
+
+#define clear_identity_p2m_entry(d, gfn, page_order) \
+                        guest_physmap_remove_page(d, gfn, gfn, page_order)
+
 /* Add foreign mapping to the guest's p2m table. */
 int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
                     unsigned long gpfn, domid_t foreign_domid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:36:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAU0-0005E5-KY; Fri, 31 Jul 2015 13:36:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATz-0005Du-8v
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:19 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	31/D3-19125-2D97BB55; Fri, 31 Jul 2015 13:36:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1438349776!24967860!1
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 11125 invoked from network); 31 Jul 2015 13:36:17 -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;
	31 Jul 2015 13:36:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATw-0004R7-3Q
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATv-0006oi-Vb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:16 +0000
Date: Fri, 31 Jul 2015 13:36:15 +0000
Message-Id: <E1ZLATv-0006oi-Vb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/passthrough: extend hypercall to
	support rdm reservation policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ab13e3dc788bf06701dd0104feb214b5870e2694
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen/passthrough: extend hypercall to support rdm reservation policy
    
    This patch extends the existing hypercall to support rdm reservation policy.
    We return error or just throw out a warning message depending on whether
    the policy is "strict" or "relaxed" when reserving RDM regions in pfn space.
    Note in some special cases, e.g. add a device to hwdomain, and remove a
    device from user domain, 'relaxed' is fine enough since this is always safe
    to hwdomain.
    
    CC: Tim Deegan <tim@xen.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    CC: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    
    --
    v13a: Fix build on ARM by passing 0 for flags to arm_smmu_assign_dev.
---
 xen/arch/x86/mm/p2m.c                       |    7 +++-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    3 +-
 xen/drivers/passthrough/arm/smmu.c          |    5 ++-
 xen/drivers/passthrough/device_tree.c       |    3 +-
 xen/drivers/passthrough/pci.c               |   15 ++++++++---
 xen/drivers/passthrough/vtd/iommu.c         |   37 +++++++++++++++++++++------
 xen/include/asm-x86/p2m.h                   |    2 +-
 xen/include/public/domctl.h                 |    3 ++
 xen/include/xen/iommu.h                     |    2 +-
 9 files changed, 57 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1e763dc..89616b7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -901,7 +901,7 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 }
 
 int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
-                           p2m_access_t p2ma)
+                           p2m_access_t p2ma, unsigned int flag)
 {
     p2m_type_t p2mt;
     p2m_access_t a;
@@ -923,7 +923,10 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         ret = 0;
     else
     {
-        ret = -EBUSY;
+        if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
+            ret = 0;
+        else
+            ret = -EBUSY;
         printk(XENLOG_G_WARNING
                "Cannot setup identity map d%d:%lx,"
                " gfn already mapped to %lx.\n",
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index e83bb35..920b35a 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -394,7 +394,8 @@ static int reassign_device(struct domain *source, struct domain *target,
 }
 
 static int amd_iommu_assign_device(struct domain *d, u8 devfn,
-                                   struct pci_dev *pdev)
+                                   struct pci_dev *pdev,
+                                   u32 flag)
 {
     struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int bdf = PCI_BDF2(pdev->bus, devfn);
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 6cc4394..be03dff 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -2605,7 +2605,7 @@ static void arm_smmu_destroy_iommu_domain(struct iommu_domain *domain)
 }
 
 static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
-			       struct device *dev)
+			       struct device *dev, u32 flag)
 {
 	struct iommu_domain *domain;
 	struct arm_smmu_xen_domain *xen_domain;
@@ -2709,7 +2709,8 @@ static int arm_smmu_reassign_dev(struct domain *s, struct domain *t,
 		return ret;
 
 	if (t) {
-		ret = arm_smmu_assign_dev(t, devfn, dev);
+		/* No flags are defined for ARM. */
+		ret = arm_smmu_assign_dev(t, devfn, dev, 0);
 		if (ret)
 			return ret;
 	}
diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
index 5d3842a..7ff79f8 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -52,7 +52,8 @@ int iommu_assign_dt_device(struct domain *d, struct dt_device_node *dev)
             goto fail;
     }
 
-    rc = hd->platform_ops->assign_device(d, 0, dt_to_dev(dev));
+    /* The flag field doesn't matter to DT device. */
+    rc = hd->platform_ops->assign_device(d, 0, dt_to_dev(dev), 0);
 
     if ( rc )
         goto fail;
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 8632265..3057b11 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1334,7 +1334,7 @@ static int device_assigned(u16 seg, u8 bus, u8 devfn)
     return pdev ? 0 : -EBUSY;
 }
 
-static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
+static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct pci_dev *pdev;
@@ -1370,7 +1370,7 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 
     pdev->fault.count = 0;
 
-    if ( (rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev))) )
+    if ( (rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev), flag)) )
         goto done;
 
     for ( ; pdev->phantom_stride; rc = 0 )
@@ -1378,7 +1378,7 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
         devfn += pdev->phantom_stride;
         if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
             break;
-        rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev));
+        rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev), flag);
         if ( rc )
             printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed (%d)\n",
                    d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
@@ -1495,6 +1495,7 @@ int iommu_do_pci_domctl(
 {
     u16 seg;
     u8 bus, devfn;
+    u32 flag;
     int ret = 0;
     uint32_t machine_sbdf;
 
@@ -1576,9 +1577,15 @@ int iommu_do_pci_domctl(
         seg = machine_sbdf >> 16;
         bus = PCI_BUS(machine_sbdf);
         devfn = PCI_DEVFN2(machine_sbdf);
+        flag = domctl->u.assign_device.flag;
+        if ( flag & ~XEN_DOMCTL_DEV_RDM_RELAXED )
+        {
+            ret = -EINVAL;
+            break;
+        }
 
         ret = device_assigned(seg, bus, devfn) ?:
-              assign_device(d, seg, bus, devfn);
+              assign_device(d, seg, bus, devfn, flag);
         if ( ret == -ERESTART )
             ret = hypercall_create_continuation(__HYPERVISOR_domctl,
                                                 "h", u_domctl);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 5aa482f..a2f3a66 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1807,7 +1807,8 @@ static void iommu_set_pgd(struct domain *d)
 }
 
 static int rmrr_identity_mapping(struct domain *d, bool_t map,
-                                 const struct acpi_rmrr_unit *rmrr)
+                                 const struct acpi_rmrr_unit *rmrr,
+                                 u32 flag)
 {
     unsigned long base_pfn = rmrr->base_address >> PAGE_SHIFT_4K;
     unsigned long end_pfn = PAGE_ALIGN_4K(rmrr->end_address) >> PAGE_SHIFT_4K;
@@ -1855,7 +1856,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
     while ( base_pfn < end_pfn )
     {
-        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw);
+        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw, flag);
 
         if ( err )
             return err;
@@ -1898,7 +1899,13 @@ static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
              PCI_BUS(bdf) == pdev->bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr);
+            /*
+             * iommu_add_device() is only called for the hardware
+             * domain (see xen/drivers/passthrough/pci.c:pci_add_device()).
+             * Since RMRRs are always reserved in the e820 map for the hardware
+             * domain, there shouldn't be a conflict.
+             */
+            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr, 0);
             if ( ret )
                 dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping failed\n",
                         pdev->domain->domain_id);
@@ -1939,7 +1946,11 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
              PCI_DEVFN2(bdf) != devfn )
             continue;
 
-        rmrr_identity_mapping(pdev->domain, 0, rmrr);
+        /*
+         * Any flag is nothing to clear these mappings but here
+         * its always safe and strict to set 0.
+         */
+        rmrr_identity_mapping(pdev->domain, 0, rmrr, 0);
     }
 
     return domain_context_unmap(pdev->domain, devfn, pdev);
@@ -2097,7 +2108,13 @@ static void __hwdom_init setup_hwdom_rmrr(struct domain *d)
     spin_lock(&pcidevs_lock);
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        ret = rmrr_identity_mapping(d, 1, rmrr);
+        /*
+         * Here means we're add a device to the hardware domain.
+         * Since RMRRs are always reserved in the e820 map for the hardware
+         * domain, there shouldn't be a conflict. So its always safe and
+         * strict to set 0.
+         */
+        ret = rmrr_identity_mapping(d, 1, rmrr, 0);
         if ( ret )
             dprintk(XENLOG_ERR VTDPREFIX,
                      "IOMMU: mapping reserved region failed\n");
@@ -2240,7 +2257,11 @@ static int reassign_device_ownership(
                  PCI_BUS(bdf) == pdev->bus &&
                  PCI_DEVFN2(bdf) == devfn )
             {
-                ret = rmrr_identity_mapping(source, 0, rmrr);
+                /*
+                 * Any RMRR flag is always ignored when remove a device,
+                 * but its always safe and strict to set 0.
+                 */
+                ret = rmrr_identity_mapping(source, 0, rmrr, 0);
                 if ( ret != -ENOENT )
                     return ret;
             }
@@ -2264,7 +2285,7 @@ static int reassign_device_ownership(
 }
 
 static int intel_iommu_assign_device(
-    struct domain *d, u8 devfn, struct pci_dev *pdev)
+    struct domain *d, u8 devfn, struct pci_dev *pdev, u32 flag)
 {
     struct acpi_rmrr_unit *rmrr;
     int ret = 0, i;
@@ -2293,7 +2314,7 @@ static int intel_iommu_assign_device(
              PCI_BUS(bdf) == bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(d, 1, rmrr);
+            ret = rmrr_identity_mapping(d, 1, rmrr, flag);
             if ( ret )
             {
                 reassign_device_ownership(d, hardware_domain, devfn, pdev);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 190a286..68da0a9 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -545,7 +545,7 @@ int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
 /* Set identity addresses in the p2m table (for pass-through) */
 int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
-                           p2m_access_t p2ma);
+                           p2m_access_t p2ma, unsigned int flag);
 
 #define clear_identity_p2m_entry(d, gfn, page_order) \
                         guest_physmap_remove_page(d, gfn, gfn, page_order)
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 631935a..675f021 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -471,6 +471,9 @@ struct xen_domctl_assign_device {
             XEN_GUEST_HANDLE_64(char) path; /* path to the device tree node */
         } dt;
     } u;
+    /* IN */
+#define XEN_DOMCTL_DEV_RDM_RELAXED      1
+    uint32_t  flag;   /* flag of assigned device */
 };
 typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 52ed3b7..1124601 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -139,7 +139,7 @@ struct iommu_ops {
     int (*add_device)(u8 devfn, device_t *dev);
     int (*enable_device)(device_t *dev);
     int (*remove_device)(u8 devfn, device_t *dev);
-    int (*assign_device)(struct domain *, u8 devfn, device_t *dev);
+    int (*assign_device)(struct domain *, u8 devfn, device_t *dev, u32 flag);
     int (*reassign_device)(struct domain *s, struct domain *t,
                            u8 devfn, device_t *dev);
 #ifdef HAS_PCI
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:36:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAU0-0005E5-KY; Fri, 31 Jul 2015 13:36:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATz-0005Du-8v
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:19 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	31/D3-19125-2D97BB55; Fri, 31 Jul 2015 13:36:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1438349776!24967860!1
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 11125 invoked from network); 31 Jul 2015 13:36:17 -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;
	31 Jul 2015 13:36:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATw-0004R7-3Q
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLATv-0006oi-Vb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:16 +0000
Date: Fri, 31 Jul 2015 13:36:15 +0000
Message-Id: <E1ZLATv-0006oi-Vb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/passthrough: extend hypercall to
	support rdm reservation policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ab13e3dc788bf06701dd0104feb214b5870e2694
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen/passthrough: extend hypercall to support rdm reservation policy
    
    This patch extends the existing hypercall to support rdm reservation policy.
    We return error or just throw out a warning message depending on whether
    the policy is "strict" or "relaxed" when reserving RDM regions in pfn space.
    Note in some special cases, e.g. add a device to hwdomain, and remove a
    device from user domain, 'relaxed' is fine enough since this is always safe
    to hwdomain.
    
    CC: Tim Deegan <tim@xen.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    CC: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    
    --
    v13a: Fix build on ARM by passing 0 for flags to arm_smmu_assign_dev.
---
 xen/arch/x86/mm/p2m.c                       |    7 +++-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    3 +-
 xen/drivers/passthrough/arm/smmu.c          |    5 ++-
 xen/drivers/passthrough/device_tree.c       |    3 +-
 xen/drivers/passthrough/pci.c               |   15 ++++++++---
 xen/drivers/passthrough/vtd/iommu.c         |   37 +++++++++++++++++++++------
 xen/include/asm-x86/p2m.h                   |    2 +-
 xen/include/public/domctl.h                 |    3 ++
 xen/include/xen/iommu.h                     |    2 +-
 9 files changed, 57 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1e763dc..89616b7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -901,7 +901,7 @@ int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 }
 
 int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
-                           p2m_access_t p2ma)
+                           p2m_access_t p2ma, unsigned int flag)
 {
     p2m_type_t p2mt;
     p2m_access_t a;
@@ -923,7 +923,10 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         ret = 0;
     else
     {
-        ret = -EBUSY;
+        if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
+            ret = 0;
+        else
+            ret = -EBUSY;
         printk(XENLOG_G_WARNING
                "Cannot setup identity map d%d:%lx,"
                " gfn already mapped to %lx.\n",
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index e83bb35..920b35a 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -394,7 +394,8 @@ static int reassign_device(struct domain *source, struct domain *target,
 }
 
 static int amd_iommu_assign_device(struct domain *d, u8 devfn,
-                                   struct pci_dev *pdev)
+                                   struct pci_dev *pdev,
+                                   u32 flag)
 {
     struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int bdf = PCI_BDF2(pdev->bus, devfn);
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 6cc4394..be03dff 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -2605,7 +2605,7 @@ static void arm_smmu_destroy_iommu_domain(struct iommu_domain *domain)
 }
 
 static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
-			       struct device *dev)
+			       struct device *dev, u32 flag)
 {
 	struct iommu_domain *domain;
 	struct arm_smmu_xen_domain *xen_domain;
@@ -2709,7 +2709,8 @@ static int arm_smmu_reassign_dev(struct domain *s, struct domain *t,
 		return ret;
 
 	if (t) {
-		ret = arm_smmu_assign_dev(t, devfn, dev);
+		/* No flags are defined for ARM. */
+		ret = arm_smmu_assign_dev(t, devfn, dev, 0);
 		if (ret)
 			return ret;
 	}
diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
index 5d3842a..7ff79f8 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -52,7 +52,8 @@ int iommu_assign_dt_device(struct domain *d, struct dt_device_node *dev)
             goto fail;
     }
 
-    rc = hd->platform_ops->assign_device(d, 0, dt_to_dev(dev));
+    /* The flag field doesn't matter to DT device. */
+    rc = hd->platform_ops->assign_device(d, 0, dt_to_dev(dev), 0);
 
     if ( rc )
         goto fail;
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 8632265..3057b11 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1334,7 +1334,7 @@ static int device_assigned(u16 seg, u8 bus, u8 devfn)
     return pdev ? 0 : -EBUSY;
 }
 
-static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
+static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct pci_dev *pdev;
@@ -1370,7 +1370,7 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 
     pdev->fault.count = 0;
 
-    if ( (rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev))) )
+    if ( (rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev), flag)) )
         goto done;
 
     for ( ; pdev->phantom_stride; rc = 0 )
@@ -1378,7 +1378,7 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
         devfn += pdev->phantom_stride;
         if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
             break;
-        rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev));
+        rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev), flag);
         if ( rc )
             printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed (%d)\n",
                    d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
@@ -1495,6 +1495,7 @@ int iommu_do_pci_domctl(
 {
     u16 seg;
     u8 bus, devfn;
+    u32 flag;
     int ret = 0;
     uint32_t machine_sbdf;
 
@@ -1576,9 +1577,15 @@ int iommu_do_pci_domctl(
         seg = machine_sbdf >> 16;
         bus = PCI_BUS(machine_sbdf);
         devfn = PCI_DEVFN2(machine_sbdf);
+        flag = domctl->u.assign_device.flag;
+        if ( flag & ~XEN_DOMCTL_DEV_RDM_RELAXED )
+        {
+            ret = -EINVAL;
+            break;
+        }
 
         ret = device_assigned(seg, bus, devfn) ?:
-              assign_device(d, seg, bus, devfn);
+              assign_device(d, seg, bus, devfn, flag);
         if ( ret == -ERESTART )
             ret = hypercall_create_continuation(__HYPERVISOR_domctl,
                                                 "h", u_domctl);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 5aa482f..a2f3a66 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1807,7 +1807,8 @@ static void iommu_set_pgd(struct domain *d)
 }
 
 static int rmrr_identity_mapping(struct domain *d, bool_t map,
-                                 const struct acpi_rmrr_unit *rmrr)
+                                 const struct acpi_rmrr_unit *rmrr,
+                                 u32 flag)
 {
     unsigned long base_pfn = rmrr->base_address >> PAGE_SHIFT_4K;
     unsigned long end_pfn = PAGE_ALIGN_4K(rmrr->end_address) >> PAGE_SHIFT_4K;
@@ -1855,7 +1856,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map,
 
     while ( base_pfn < end_pfn )
     {
-        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw);
+        int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw, flag);
 
         if ( err )
             return err;
@@ -1898,7 +1899,13 @@ static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
              PCI_BUS(bdf) == pdev->bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr);
+            /*
+             * iommu_add_device() is only called for the hardware
+             * domain (see xen/drivers/passthrough/pci.c:pci_add_device()).
+             * Since RMRRs are always reserved in the e820 map for the hardware
+             * domain, there shouldn't be a conflict.
+             */
+            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr, 0);
             if ( ret )
                 dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping failed\n",
                         pdev->domain->domain_id);
@@ -1939,7 +1946,11 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
              PCI_DEVFN2(bdf) != devfn )
             continue;
 
-        rmrr_identity_mapping(pdev->domain, 0, rmrr);
+        /*
+         * Any flag is nothing to clear these mappings but here
+         * its always safe and strict to set 0.
+         */
+        rmrr_identity_mapping(pdev->domain, 0, rmrr, 0);
     }
 
     return domain_context_unmap(pdev->domain, devfn, pdev);
@@ -2097,7 +2108,13 @@ static void __hwdom_init setup_hwdom_rmrr(struct domain *d)
     spin_lock(&pcidevs_lock);
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        ret = rmrr_identity_mapping(d, 1, rmrr);
+        /*
+         * Here means we're add a device to the hardware domain.
+         * Since RMRRs are always reserved in the e820 map for the hardware
+         * domain, there shouldn't be a conflict. So its always safe and
+         * strict to set 0.
+         */
+        ret = rmrr_identity_mapping(d, 1, rmrr, 0);
         if ( ret )
             dprintk(XENLOG_ERR VTDPREFIX,
                      "IOMMU: mapping reserved region failed\n");
@@ -2240,7 +2257,11 @@ static int reassign_device_ownership(
                  PCI_BUS(bdf) == pdev->bus &&
                  PCI_DEVFN2(bdf) == devfn )
             {
-                ret = rmrr_identity_mapping(source, 0, rmrr);
+                /*
+                 * Any RMRR flag is always ignored when remove a device,
+                 * but its always safe and strict to set 0.
+                 */
+                ret = rmrr_identity_mapping(source, 0, rmrr, 0);
                 if ( ret != -ENOENT )
                     return ret;
             }
@@ -2264,7 +2285,7 @@ static int reassign_device_ownership(
 }
 
 static int intel_iommu_assign_device(
-    struct domain *d, u8 devfn, struct pci_dev *pdev)
+    struct domain *d, u8 devfn, struct pci_dev *pdev, u32 flag)
 {
     struct acpi_rmrr_unit *rmrr;
     int ret = 0, i;
@@ -2293,7 +2314,7 @@ static int intel_iommu_assign_device(
              PCI_BUS(bdf) == bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(d, 1, rmrr);
+            ret = rmrr_identity_mapping(d, 1, rmrr, flag);
             if ( ret )
             {
                 reassign_device_ownership(d, hardware_domain, devfn, pdev);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 190a286..68da0a9 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -545,7 +545,7 @@ int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
 /* Set identity addresses in the p2m table (for pass-through) */
 int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
-                           p2m_access_t p2ma);
+                           p2m_access_t p2ma, unsigned int flag);
 
 #define clear_identity_p2m_entry(d, gfn, page_order) \
                         guest_physmap_remove_page(d, gfn, gfn, page_order)
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 631935a..675f021 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -471,6 +471,9 @@ struct xen_domctl_assign_device {
             XEN_GUEST_HANDLE_64(char) path; /* path to the device tree node */
         } dt;
     } u;
+    /* IN */
+#define XEN_DOMCTL_DEV_RDM_RELAXED      1
+    uint32_t  flag;   /* flag of assigned device */
 };
 typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 52ed3b7..1124601 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -139,7 +139,7 @@ struct iommu_ops {
     int (*add_device)(u8 devfn, device_t *dev);
     int (*enable_device)(device_t *dev);
     int (*remove_device)(u8 devfn, device_t *dev);
-    int (*assign_device)(struct domain *, u8 devfn, device_t *dev);
+    int (*assign_device)(struct domain *, u8 devfn, device_t *dev, u32 flag);
     int (*reassign_device)(struct domain *s, struct domain *t,
                            u8 devfn, device_t *dev);
 #ifdef HAS_PCI
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:36:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAU9-0005O3-PT; Fri, 31 Jul 2015 13:36: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 1ZLAU8-0005JR-Io
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:28 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	BE/BD-02324-BD97BB55; Fri, 31 Jul 2015 13:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438349786!19579000!1
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 19747 invoked from network); 31 Jul 2015 13:36:27 -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;
	31 Jul 2015 13:36:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAU6-0004RF-D1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAU6-0006pW-9C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:26 +0000
Date: Fri, 31 Jul 2015 13:36:26 +0000
Message-Id: <E1ZLAU6-0006pW-9C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: enable XENMEM_memory_map in hvm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46648eb95f1a70940bb22c40d43703b7cff99a88
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen: enable XENMEM_memory_map in hvm
    
    This patch enables XENMEM_memory_map in hvm. So hvmloader can
    use it to setup the e820 mappings.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    2 --
 xen/arch/x86/mm.c      |    6 ------
 2 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c07e3ef..d860579 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4855,7 +4855,6 @@ static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( cmd & MEMOP_CMD_MASK )
     {
-    case XENMEM_memory_map:
     case XENMEM_machine_memory_map:
     case XENMEM_machphys_mapping:
         return -ENOSYS;
@@ -4931,7 +4930,6 @@ static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( cmd & MEMOP_CMD_MASK )
     {
-    case XENMEM_memory_map:
     case XENMEM_machine_memory_map:
     case XENMEM_machphys_mapping:
         return -ENOSYS;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f316377..bfe3761 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4773,12 +4773,6 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        if ( is_hvm_domain(d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries);
         if ( e820 == NULL )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:36:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAU9-0005O3-PT; Fri, 31 Jul 2015 13:36: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 1ZLAU8-0005JR-Io
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:28 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	BE/BD-02324-BD97BB55; Fri, 31 Jul 2015 13:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438349786!19579000!1
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 19747 invoked from network); 31 Jul 2015 13:36:27 -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;
	31 Jul 2015 13:36:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAU6-0004RF-D1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAU6-0006pW-9C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:26 +0000
Date: Fri, 31 Jul 2015 13:36:26 +0000
Message-Id: <E1ZLAU6-0006pW-9C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: enable XENMEM_memory_map in hvm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46648eb95f1a70940bb22c40d43703b7cff99a88
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    xen: enable XENMEM_memory_map in hvm
    
    This patch enables XENMEM_memory_map in hvm. So hvmloader can
    use it to setup the e820 mappings.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    2 --
 xen/arch/x86/mm.c      |    6 ------
 2 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c07e3ef..d860579 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4855,7 +4855,6 @@ static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( cmd & MEMOP_CMD_MASK )
     {
-    case XENMEM_memory_map:
     case XENMEM_machine_memory_map:
     case XENMEM_machphys_mapping:
         return -ENOSYS;
@@ -4931,7 +4930,6 @@ static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( cmd & MEMOP_CMD_MASK )
     {
-    case XENMEM_memory_map:
     case XENMEM_machine_memory_map:
     case XENMEM_machphys_mapping:
         return -ENOSYS;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f316377..bfe3761 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4773,12 +4773,6 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        if ( is_hvm_domain(d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries);
         if ( e820 == NULL )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:36:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAUK-0005jo-SD; Fri, 31 Jul 2015 13:36: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 1ZLAUJ-0005hh-54
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:39 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/01-06021-6E97BB55; Fri, 31 Jul 2015 13:36:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349796!31145791!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 3121 invoked from network); 31 Jul 2015 13:36:37 -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;
	31 Jul 2015 13:36:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUG-0004RN-Iq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUG-0006qd-Hn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:36 +0000
Date: Fri, 31 Jul 2015 13:36:36 +0000
Message-Id: <E1ZLAUG-0006qd-Hn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: get guest memory map into
	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 07d73925eaa066c3ae2fb161246863e99e79d9f7
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:19 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader: get guest memory map into memory_map[]
    
    Now we get this map layout by call XENMEM_memory_map then
    save them into one global variable memory_map[]. It should
    include lowmem range, rdm range and highmem range. Note
    rdm range and highmem range may not exist in some cases.
    
    And here we need to check if any reserved memory conflicts with
    [RESERVED_MEMORY_DYNAMIC_START, RESERVED_MEMORY_DYNAMIC_END).
    This range is used to allocate memory in hvmloder level, and
    we would lead hvmloader failed in case of conflict since its
    another rare possibility in real world.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/firmware/hvmloader/e820.c      |   32 ++++++++++++++++++++++++++++++++
 tools/firmware/hvmloader/e820.h      |    7 +++++++
 tools/firmware/hvmloader/hvmloader.c |    2 ++
 tools/firmware/hvmloader/util.c      |   26 ++++++++++++++++++++++++++
 tools/firmware/hvmloader/util.h      |   12 ++++++++++++
 5 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 2e05e93..7a414ab 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -23,6 +23,38 @@
 #include "config.h"
 #include "util.h"
 
+struct e820map memory_map;
+
+void memory_map_setup(void)
+{
+    unsigned int nr_entries = E820MAX, i;
+    int rc;
+    uint64_t alloc_addr = RESERVED_MEMORY_DYNAMIC_START;
+    uint64_t alloc_size = RESERVED_MEMORY_DYNAMIC_END - alloc_addr;
+
+    rc = get_mem_mapping_layout(memory_map.map, &nr_entries);
+
+    if ( rc || !nr_entries )
+    {
+        printf("Get guest memory maps[%d] failed. (%d)\n", nr_entries, rc);
+        BUG();
+    }
+
+    memory_map.nr_map = nr_entries;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             check_overlap(alloc_addr, alloc_size,
+                           memory_map.map[i].addr, memory_map.map[i].size) )
+        {
+            printf("Fail to setup memory map due to conflict");
+            printf(" on dynamic reserved memory range.\n");
+            BUG();
+        }
+    }
+}
+
 void dump_e820_table(struct e820entry *e820, unsigned int nr)
 {
     uint64_t last_end = 0, start, end;
diff --git a/tools/firmware/hvmloader/e820.h b/tools/firmware/hvmloader/e820.h
index b2ead7f..8b5a9e0 100644
--- a/tools/firmware/hvmloader/e820.h
+++ b/tools/firmware/hvmloader/e820.h
@@ -15,6 +15,13 @@ struct e820entry {
     uint32_t type;
 } __attribute__((packed));
 
+#define E820MAX	128
+
+struct e820map {
+    unsigned int nr_map;
+    struct e820entry map[E820MAX];
+};
+
 #endif /* __HVMLOADER_E820_H__ */
 
 /*
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 25b7f08..84c588c 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -262,6 +262,8 @@ int main(void)
 
     init_hypercalls();
 
+    memory_map_setup();
+
     xenbus_setup();
 
     bios = detect_bios();
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 80d822f..122e3fa 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -27,6 +27,17 @@
 #include <xen/memory.h>
 #include <xen/sched.h>
 
+/*
+ * Check whether there exists overlap in the specified memory range.
+ * Returns true if exists, else returns false.
+ */
+bool check_overlap(uint64_t start, uint64_t size,
+                   uint64_t reserved_start, uint64_t reserved_size)
+{
+    return (start + size > reserved_start) &&
+            (start < reserved_start + reserved_size);
+}
+
 void wrmsr(uint32_t idx, uint64_t v)
 {
     asm volatile (
@@ -368,6 +379,21 @@ uuid_to_string(char *dest, uint8_t *uuid)
     *p = '\0';
 }
 
+int get_mem_mapping_layout(struct e820entry entries[], uint32_t *max_entries)
+{
+    int rc;
+    struct xen_memory_map memmap = {
+        .nr_entries = *max_entries
+    };
+
+    set_xen_guest_handle(memmap.buffer, entries);
+
+    rc = hypercall_memory_op(XENMEM_memory_map, &memmap);
+    *max_entries = memmap.nr_entries;
+
+    return rc;
+}
+
 void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns)
 {
     static int over_allocated;
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index f99c0f19..1100a3b 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -4,8 +4,10 @@
 #include <stdarg.h>
 #include <stdint.h>
 #include <stddef.h>
+#include <stdbool.h>
 #include <xen/xen.h>
 #include <xen/hvm/hvm_info_table.h>
+#include "e820.h"
 
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
@@ -222,6 +224,9 @@ int hvm_param_set(uint32_t index, uint64_t value);
 /* Setup PCI bus */
 void pci_setup(void);
 
+/* Setup memory map  */
+void memory_map_setup(void);
+
 /* Prepare the 32bit BIOS */
 uint32_t rombios_highbios_setup(void);
 
@@ -249,6 +254,13 @@ void perform_tests(void);
 
 extern char _start[], _end[];
 
+int get_mem_mapping_layout(struct e820entry entries[],
+                           unsigned int *max_entries);
+
+extern struct e820map memory_map;
+bool check_overlap(uint64_t start, uint64_t size,
+                   uint64_t reserved_start, uint64_t reserved_size);
+
 #endif /* __HVMLOADER_UTIL_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 Fri Jul 31 13:36:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAUK-0005jo-SD; Fri, 31 Jul 2015 13:36: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 1ZLAUJ-0005hh-54
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:39 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/01-06021-6E97BB55; Fri, 31 Jul 2015 13:36:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349796!31145791!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 3121 invoked from network); 31 Jul 2015 13:36:37 -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;
	31 Jul 2015 13:36:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUG-0004RN-Iq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUG-0006qd-Hn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:36 +0000
Date: Fri, 31 Jul 2015 13:36:36 +0000
Message-Id: <E1ZLAUG-0006qd-Hn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: get guest memory map into
	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 07d73925eaa066c3ae2fb161246863e99e79d9f7
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:19 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader: get guest memory map into memory_map[]
    
    Now we get this map layout by call XENMEM_memory_map then
    save them into one global variable memory_map[]. It should
    include lowmem range, rdm range and highmem range. Note
    rdm range and highmem range may not exist in some cases.
    
    And here we need to check if any reserved memory conflicts with
    [RESERVED_MEMORY_DYNAMIC_START, RESERVED_MEMORY_DYNAMIC_END).
    This range is used to allocate memory in hvmloder level, and
    we would lead hvmloader failed in case of conflict since its
    another rare possibility in real world.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/firmware/hvmloader/e820.c      |   32 ++++++++++++++++++++++++++++++++
 tools/firmware/hvmloader/e820.h      |    7 +++++++
 tools/firmware/hvmloader/hvmloader.c |    2 ++
 tools/firmware/hvmloader/util.c      |   26 ++++++++++++++++++++++++++
 tools/firmware/hvmloader/util.h      |   12 ++++++++++++
 5 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 2e05e93..7a414ab 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -23,6 +23,38 @@
 #include "config.h"
 #include "util.h"
 
+struct e820map memory_map;
+
+void memory_map_setup(void)
+{
+    unsigned int nr_entries = E820MAX, i;
+    int rc;
+    uint64_t alloc_addr = RESERVED_MEMORY_DYNAMIC_START;
+    uint64_t alloc_size = RESERVED_MEMORY_DYNAMIC_END - alloc_addr;
+
+    rc = get_mem_mapping_layout(memory_map.map, &nr_entries);
+
+    if ( rc || !nr_entries )
+    {
+        printf("Get guest memory maps[%d] failed. (%d)\n", nr_entries, rc);
+        BUG();
+    }
+
+    memory_map.nr_map = nr_entries;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             check_overlap(alloc_addr, alloc_size,
+                           memory_map.map[i].addr, memory_map.map[i].size) )
+        {
+            printf("Fail to setup memory map due to conflict");
+            printf(" on dynamic reserved memory range.\n");
+            BUG();
+        }
+    }
+}
+
 void dump_e820_table(struct e820entry *e820, unsigned int nr)
 {
     uint64_t last_end = 0, start, end;
diff --git a/tools/firmware/hvmloader/e820.h b/tools/firmware/hvmloader/e820.h
index b2ead7f..8b5a9e0 100644
--- a/tools/firmware/hvmloader/e820.h
+++ b/tools/firmware/hvmloader/e820.h
@@ -15,6 +15,13 @@ struct e820entry {
     uint32_t type;
 } __attribute__((packed));
 
+#define E820MAX	128
+
+struct e820map {
+    unsigned int nr_map;
+    struct e820entry map[E820MAX];
+};
+
 #endif /* __HVMLOADER_E820_H__ */
 
 /*
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 25b7f08..84c588c 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -262,6 +262,8 @@ int main(void)
 
     init_hypercalls();
 
+    memory_map_setup();
+
     xenbus_setup();
 
     bios = detect_bios();
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 80d822f..122e3fa 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -27,6 +27,17 @@
 #include <xen/memory.h>
 #include <xen/sched.h>
 
+/*
+ * Check whether there exists overlap in the specified memory range.
+ * Returns true if exists, else returns false.
+ */
+bool check_overlap(uint64_t start, uint64_t size,
+                   uint64_t reserved_start, uint64_t reserved_size)
+{
+    return (start + size > reserved_start) &&
+            (start < reserved_start + reserved_size);
+}
+
 void wrmsr(uint32_t idx, uint64_t v)
 {
     asm volatile (
@@ -368,6 +379,21 @@ uuid_to_string(char *dest, uint8_t *uuid)
     *p = '\0';
 }
 
+int get_mem_mapping_layout(struct e820entry entries[], uint32_t *max_entries)
+{
+    int rc;
+    struct xen_memory_map memmap = {
+        .nr_entries = *max_entries
+    };
+
+    set_xen_guest_handle(memmap.buffer, entries);
+
+    rc = hypercall_memory_op(XENMEM_memory_map, &memmap);
+    *max_entries = memmap.nr_entries;
+
+    return rc;
+}
+
 void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns)
 {
     static int over_allocated;
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index f99c0f19..1100a3b 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -4,8 +4,10 @@
 #include <stdarg.h>
 #include <stdint.h>
 #include <stddef.h>
+#include <stdbool.h>
 #include <xen/xen.h>
 #include <xen/hvm/hvm_info_table.h>
+#include "e820.h"
 
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
@@ -222,6 +224,9 @@ int hvm_param_set(uint32_t index, uint64_t value);
 /* Setup PCI bus */
 void pci_setup(void);
 
+/* Setup memory map  */
+void memory_map_setup(void);
+
 /* Prepare the 32bit BIOS */
 uint32_t rombios_highbios_setup(void);
 
@@ -249,6 +254,13 @@ void perform_tests(void);
 
 extern char _start[], _end[];
 
+int get_mem_mapping_layout(struct e820entry entries[],
+                           unsigned int *max_entries);
+
+extern struct e820map memory_map;
+bool check_overlap(uint64_t start, uint64_t size,
+                   uint64_t reserved_start, uint64_t reserved_size);
+
 #endif /* __HVMLOADER_UTIL_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 Fri Jul 31 13:36:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAUU-0005n9-Up; Fri, 31 Jul 2015 13:36: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 1ZLAUT-0005mw-C4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:49 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	FB/DD-15765-0F97BB55; Fri, 31 Jul 2015 13:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438349806!36923173!1
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 32656 invoked from network); 31 Jul 2015 13:36:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:36:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUQ-0004RW-OE
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUQ-0006r1-N3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:46 +0000
Date: Fri, 31 Jul 2015 13:36:46 +0000
Message-Id: <E1ZLAUQ-0006r1-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/pci: try to avoid placing
	BARs in RMRRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b730fc3e157a7b401305cecad7fcefee28340e2c
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Wed Jul 22 15:24:49 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader/pci: try to avoid placing BARs in RMRRs
    
    Try to avoid placing PCI BARs over RMRRs:
    
    - If mmio_hole_size is not specified, and the existing MMIO range has
      RMRRs in it, and there is space to expand the hole in lowmem without
      moving more memory, then make the MMIO hole as large as possible.
    
    - When placing RMRRs, find the next RMRR higher than the current base
      in the lowmem mmio hole.  If it overlaps, skip ahead of it and find
      the next one.
    
    This certainly won't work in all cases, but it should work in a
    significant number of cases.  Additionally, users should be able to
    work around problems by setting mmio_hole_size larger in the guest
    config.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/firmware/hvmloader/pci.c |   64 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 5ff87a7..ff81fba 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -38,6 +38,45 @@ uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 enum virtual_vga virtual_vga = VGA_none;
 unsigned long igd_opregion_pgbase = 0;
 
+/* Check if the specified range conflicts with any reserved device memory. */
+static bool check_overlap_all(uint64_t start, uint64_t size)
+{
+    unsigned int i;
+
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             check_overlap(start, size,
+                           memory_map.map[i].addr,
+                           memory_map.map[i].size) )
+            return true;
+    }
+
+    return false;
+}
+
+/* Find the lowest RMRR ending above base but below 4G. */
+static int find_next_rmrr(uint32_t base)
+{
+    unsigned int i;
+    int next_rmrr = -1;
+    uint64_t end, min_end = 1ULL << 32;
+
+    for ( i = 0; i < memory_map.nr_map ; i++ )
+    {
+        end = memory_map.map[i].addr + memory_map.map[i].size;
+
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             end > base && end <= min_end )
+        {
+            next_rmrr = i;
+            min_end = end;
+        }
+    }
+
+    return next_rmrr;
+}
+
 void pci_setup(void)
 {
     uint8_t is_64bar, using_64bar, bar64_relocate = 0;
@@ -46,6 +85,7 @@ void pci_setup(void)
     uint32_t vga_devfn = 256;
     uint16_t class, vendor_id, device_id;
     unsigned int bar, pin, link, isa_irq;
+    int next_rmrr;
 
     /* Resources assignable to PCI devices via BARs. */
     struct resource {
@@ -299,6 +339,15 @@ void pci_setup(void)
                     || (((pci_mem_start << 1) >> PAGE_SHIFT)
                         >= hvm_info->low_mem_pgend)) )
             pci_mem_start <<= 1;
+
+        /*
+         * Try to accommodate RMRRs in our MMIO region on a best-effort basis.
+         * If we have RMRRs in the range, then make pci_mem_start just after
+         * hvm_info->low_mem_pgend.
+         */
+        if ( pci_mem_start > (hvm_info->low_mem_pgend << PAGE_SHIFT) &&
+             check_overlap_all(pci_mem_start, pci_mem_end-pci_mem_start) )
+            pci_mem_start = hvm_info->low_mem_pgend << PAGE_SHIFT;
     }
 
     if ( mmio_total > (pci_mem_end - pci_mem_start) )
@@ -352,6 +401,8 @@ void pci_setup(void)
     io_resource.base = 0xc000;
     io_resource.max = 0x10000;
 
+    next_rmrr = find_next_rmrr(pci_mem_start);
+
     /* Assign iomem and ioport resources in descending order of size. */
     for ( i = 0; i < nr_bars; i++ )
     {
@@ -407,6 +458,19 @@ void pci_setup(void)
         }
 
         base = (resource->base  + bar_sz - 1) & ~(uint64_t)(bar_sz - 1);
+
+        /* If we're using mem_resource, check for RMRR conflicts. */
+        while ( resource == &mem_resource &&
+                next_rmrr >= 0 &&
+                check_overlap(base, bar_sz,
+                              memory_map.map[next_rmrr].addr,
+                              memory_map.map[next_rmrr].size) )
+        {
+            base = memory_map.map[next_rmrr].addr + memory_map.map[next_rmrr].size;
+            base = (base + bar_sz - 1) & ~(bar_sz - 1);
+            next_rmrr = find_next_rmrr(base);
+        }
+
         bar_data |= (uint32_t)base;
         bar_data_upper = (uint32_t)(base >> 32);
         base += bar_sz;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:36:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:36: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 1ZLAUU-0005n9-Up; Fri, 31 Jul 2015 13:36: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 1ZLAUT-0005mw-C4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:49 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	FB/DD-15765-0F97BB55; Fri, 31 Jul 2015 13:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438349806!36923173!1
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 32656 invoked from network); 31 Jul 2015 13:36:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:36:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUQ-0004RW-OE
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUQ-0006r1-N3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:46 +0000
Date: Fri, 31 Jul 2015 13:36:46 +0000
Message-Id: <E1ZLAUQ-0006r1-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/pci: try to avoid placing
	BARs in RMRRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b730fc3e157a7b401305cecad7fcefee28340e2c
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Wed Jul 22 15:24:49 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader/pci: try to avoid placing BARs in RMRRs
    
    Try to avoid placing PCI BARs over RMRRs:
    
    - If mmio_hole_size is not specified, and the existing MMIO range has
      RMRRs in it, and there is space to expand the hole in lowmem without
      moving more memory, then make the MMIO hole as large as possible.
    
    - When placing RMRRs, find the next RMRR higher than the current base
      in the lowmem mmio hole.  If it overlaps, skip ahead of it and find
      the next one.
    
    This certainly won't work in all cases, but it should work in a
    significant number of cases.  Additionally, users should be able to
    work around problems by setting mmio_hole_size larger in the guest
    config.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/firmware/hvmloader/pci.c |   64 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 5ff87a7..ff81fba 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -38,6 +38,45 @@ uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 enum virtual_vga virtual_vga = VGA_none;
 unsigned long igd_opregion_pgbase = 0;
 
+/* Check if the specified range conflicts with any reserved device memory. */
+static bool check_overlap_all(uint64_t start, uint64_t size)
+{
+    unsigned int i;
+
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             check_overlap(start, size,
+                           memory_map.map[i].addr,
+                           memory_map.map[i].size) )
+            return true;
+    }
+
+    return false;
+}
+
+/* Find the lowest RMRR ending above base but below 4G. */
+static int find_next_rmrr(uint32_t base)
+{
+    unsigned int i;
+    int next_rmrr = -1;
+    uint64_t end, min_end = 1ULL << 32;
+
+    for ( i = 0; i < memory_map.nr_map ; i++ )
+    {
+        end = memory_map.map[i].addr + memory_map.map[i].size;
+
+        if ( memory_map.map[i].type == E820_RESERVED &&
+             end > base && end <= min_end )
+        {
+            next_rmrr = i;
+            min_end = end;
+        }
+    }
+
+    return next_rmrr;
+}
+
 void pci_setup(void)
 {
     uint8_t is_64bar, using_64bar, bar64_relocate = 0;
@@ -46,6 +85,7 @@ void pci_setup(void)
     uint32_t vga_devfn = 256;
     uint16_t class, vendor_id, device_id;
     unsigned int bar, pin, link, isa_irq;
+    int next_rmrr;
 
     /* Resources assignable to PCI devices via BARs. */
     struct resource {
@@ -299,6 +339,15 @@ void pci_setup(void)
                     || (((pci_mem_start << 1) >> PAGE_SHIFT)
                         >= hvm_info->low_mem_pgend)) )
             pci_mem_start <<= 1;
+
+        /*
+         * Try to accommodate RMRRs in our MMIO region on a best-effort basis.
+         * If we have RMRRs in the range, then make pci_mem_start just after
+         * hvm_info->low_mem_pgend.
+         */
+        if ( pci_mem_start > (hvm_info->low_mem_pgend << PAGE_SHIFT) &&
+             check_overlap_all(pci_mem_start, pci_mem_end-pci_mem_start) )
+            pci_mem_start = hvm_info->low_mem_pgend << PAGE_SHIFT;
     }
 
     if ( mmio_total > (pci_mem_end - pci_mem_start) )
@@ -352,6 +401,8 @@ void pci_setup(void)
     io_resource.base = 0xc000;
     io_resource.max = 0x10000;
 
+    next_rmrr = find_next_rmrr(pci_mem_start);
+
     /* Assign iomem and ioport resources in descending order of size. */
     for ( i = 0; i < nr_bars; i++ )
     {
@@ -407,6 +458,19 @@ void pci_setup(void)
         }
 
         base = (resource->base  + bar_sz - 1) & ~(uint64_t)(bar_sz - 1);
+
+        /* If we're using mem_resource, check for RMRR conflicts. */
+        while ( resource == &mem_resource &&
+                next_rmrr >= 0 &&
+                check_overlap(base, bar_sz,
+                              memory_map.map[next_rmrr].addr,
+                              memory_map.map[next_rmrr].size) )
+        {
+            base = memory_map.map[next_rmrr].addr + memory_map.map[next_rmrr].size;
+            base = (base + bar_sz - 1) & ~(bar_sz - 1);
+            next_rmrr = find_next_rmrr(base);
+        }
+
         bar_data |= (uint32_t)base;
         bar_data_upper = (uint32_t)(base >> 32);
         base += bar_sz;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:37:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUf-0005oU-1A; Fri, 31 Jul 2015 13:37: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 1ZLAUd-0005oH-GF
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:59 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	23/D3-32615-AF97BB55; Fri, 31 Jul 2015 13:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1438349817!24962577!1
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 8385 invoked from network); 31 Jul 2015 13:36:57 -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;
	31 Jul 2015 13:36:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUa-0004Rg-T6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUa-0006rP-S8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:56 +0000
Date: Fri, 31 Jul 2015 13:36:56 +0000
Message-Id: <E1ZLAUa-0006rP-S8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/e820: construct guest e820
	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 596dd0042a06b746507879dbbde9a81bf46e5eb5
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader/e820: construct guest e820 table
    
    Now use the hypervisor-supplied memory map to build our final e820 table:
    * Add regions for BIOS ranges and other special mappings not in the
      hypervisor map
    * Add in the hypervisor supplied regions
    * Adjust the lowmem and highmem regions if we've had to relocate
      memory (adding a highmem region if necessary)
    * Sort all the ranges so that they appear in memory order.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 tools/firmware/hvmloader/e820.c |  109 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 96 insertions(+), 13 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 7a414ab..a6cacdf 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -105,7 +105,11 @@ int build_e820_table(struct e820entry *e820,
                      unsigned int lowmem_reserved_base,
                      unsigned int bios_image_base)
 {
-    unsigned int nr = 0;
+    unsigned int nr = 0, i, j;
+    uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    uint32_t add_high_mem = 0;
+    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
+    uint64_t map_start, map_size, map_end;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -149,13 +153,6 @@ int build_e820_table(struct e820entry *e820,
     e820[nr].type = E820_RESERVED;
     nr++;
 
-    /* Low RAM goes here. Reserve space for special pages. */
-    BUG_ON((hvm_info->low_mem_pgend << PAGE_SHIFT) < (2u << 20));
-    e820[nr].addr = 0x100000;
-    e820[nr].size = (hvm_info->low_mem_pgend << PAGE_SHIFT) - e820[nr].addr;
-    e820[nr].type = E820_RAM;
-    nr++;
-
     /*
      * Explicitly reserve space for special pages.
      * This space starts at RESERVED_MEMBASE an extends to cover various
@@ -191,16 +188,102 @@ int build_e820_table(struct e820entry *e820,
         nr++;
     }
 
+    /* Low RAM goes here. Reserve space for special pages. */
+    BUG_ON(low_mem_end < (2u << 20));
 
-    if ( hvm_info->high_mem_pgend )
+    /*
+     * Construct E820 table according to recorded memory map.
+     *
+     * The memory map created by toolstack may include,
+     *
+     * #1. Low memory region
+     *
+     * Low RAM starts at least from 1M to make sure all standard regions
+     * of the PC memory map, like BIOS, VGA memory-mapped I/O and vgabios,
+     * have enough space.
+     *
+     * #2. Reserved regions if they exist
+     *
+     * #3. High memory region if it exists
+     *
+     * Note we just have one low memory entry and one high mmeory entry if
+     * exists.
+     *
+     * But we may have relocated RAM to allocate sufficient MMIO previously
+     * so low_mem_pgend would be changed over there. And here memory_map[]
+     * records the original low/high memory, so if low_mem_end is less than
+     * the original we need to revise low/high memory range firstly.
+     */
+    for ( i = 0; i < memory_map.nr_map; i++ )
     {
-        e820[nr].addr = ((uint64_t)1 << 32);
-        e820[nr].size =
-            ((uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT) - e820[nr].addr;
-        e820[nr].type = E820_RAM;
+        map_start = memory_map.map[i].addr;
+        map_size = memory_map.map[i].size;
+        map_end = map_start + map_size;
+
+        /* If we need to adjust lowmem. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             low_mem_end > map_start && low_mem_end < map_end )
+        {
+            add_high_mem = map_end - low_mem_end;
+            memory_map.map[i].size = low_mem_end - map_start;
+            break;
+        }
+    }
+
+    /* If we need to adjust highmem. */
+    if ( add_high_mem )
+    {
+        /* Modify the existing highmem region if it exists. */
+        for ( i = 0; i < memory_map.nr_map; i++ )
+        {
+            map_start = memory_map.map[i].addr;
+            map_size = memory_map.map[i].size;
+            map_end = map_start + map_size;
+
+            if ( memory_map.map[i].type == E820_RAM &&
+                 map_start == ((uint64_t)1 << 32))
+            {
+                memory_map.map[i].size += add_high_mem;
+                break;
+            }
+        }
+
+        /* If there was no highmem region, just create one. */
+        if ( i == memory_map.nr_map )
+        {
+            memory_map.map[i].addr = ((uint64_t)1 << 32);
+            memory_map.map[i].size = add_high_mem;
+            memory_map.map[i].type = E820_RAM;
+            memory_map.nr_map++;
+        }
+
+        /* A sanity check if high memory is broken. */
+        BUG_ON( high_mem_end !=
+                memory_map.map[i].addr + memory_map.map[i].size);
+    }
+
+    /* Now fill e820. */
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        e820[nr] = memory_map.map[i];
         nr++;
     }
 
+    /* Finally we need to sort all e820 entries. */
+    for ( j = 0; j < nr - 1; j++ )
+    {
+        for ( i = j + 1; i < nr; i++ )
+        {
+            if ( e820[j].addr > e820[i].addr )
+            {
+                struct e820entry tmp = e820[j];
+
+                e820[j] = e820[i];
+                e820[i] = tmp;
+            }
+        }
+    }
+
     return nr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUf-0005oU-1A; Fri, 31 Jul 2015 13:37: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 1ZLAUd-0005oH-GF
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:59 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	23/D3-32615-AF97BB55; Fri, 31 Jul 2015 13:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1438349817!24962577!1
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 8385 invoked from network); 31 Jul 2015 13:36:57 -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;
	31 Jul 2015 13:36:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUa-0004Rg-T6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUa-0006rP-S8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:36:56 +0000
Date: Fri, 31 Jul 2015 13:36:56 +0000
Message-Id: <E1ZLAUa-0006rP-S8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/e820: construct guest e820
	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 596dd0042a06b746507879dbbde9a81bf46e5eb5
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    hvmloader/e820: construct guest e820 table
    
    Now use the hypervisor-supplied memory map to build our final e820 table:
    * Add regions for BIOS ranges and other special mappings not in the
      hypervisor map
    * Add in the hypervisor supplied regions
    * Adjust the lowmem and highmem regions if we've had to relocate
      memory (adding a highmem region if necessary)
    * Sort all the ranges so that they appear in memory order.
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 tools/firmware/hvmloader/e820.c |  109 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 96 insertions(+), 13 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 7a414ab..a6cacdf 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -105,7 +105,11 @@ int build_e820_table(struct e820entry *e820,
                      unsigned int lowmem_reserved_base,
                      unsigned int bios_image_base)
 {
-    unsigned int nr = 0;
+    unsigned int nr = 0, i, j;
+    uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    uint32_t add_high_mem = 0;
+    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
+    uint64_t map_start, map_size, map_end;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -149,13 +153,6 @@ int build_e820_table(struct e820entry *e820,
     e820[nr].type = E820_RESERVED;
     nr++;
 
-    /* Low RAM goes here. Reserve space for special pages. */
-    BUG_ON((hvm_info->low_mem_pgend << PAGE_SHIFT) < (2u << 20));
-    e820[nr].addr = 0x100000;
-    e820[nr].size = (hvm_info->low_mem_pgend << PAGE_SHIFT) - e820[nr].addr;
-    e820[nr].type = E820_RAM;
-    nr++;
-
     /*
      * Explicitly reserve space for special pages.
      * This space starts at RESERVED_MEMBASE an extends to cover various
@@ -191,16 +188,102 @@ int build_e820_table(struct e820entry *e820,
         nr++;
     }
 
+    /* Low RAM goes here. Reserve space for special pages. */
+    BUG_ON(low_mem_end < (2u << 20));
 
-    if ( hvm_info->high_mem_pgend )
+    /*
+     * Construct E820 table according to recorded memory map.
+     *
+     * The memory map created by toolstack may include,
+     *
+     * #1. Low memory region
+     *
+     * Low RAM starts at least from 1M to make sure all standard regions
+     * of the PC memory map, like BIOS, VGA memory-mapped I/O and vgabios,
+     * have enough space.
+     *
+     * #2. Reserved regions if they exist
+     *
+     * #3. High memory region if it exists
+     *
+     * Note we just have one low memory entry and one high mmeory entry if
+     * exists.
+     *
+     * But we may have relocated RAM to allocate sufficient MMIO previously
+     * so low_mem_pgend would be changed over there. And here memory_map[]
+     * records the original low/high memory, so if low_mem_end is less than
+     * the original we need to revise low/high memory range firstly.
+     */
+    for ( i = 0; i < memory_map.nr_map; i++ )
     {
-        e820[nr].addr = ((uint64_t)1 << 32);
-        e820[nr].size =
-            ((uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT) - e820[nr].addr;
-        e820[nr].type = E820_RAM;
+        map_start = memory_map.map[i].addr;
+        map_size = memory_map.map[i].size;
+        map_end = map_start + map_size;
+
+        /* If we need to adjust lowmem. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             low_mem_end > map_start && low_mem_end < map_end )
+        {
+            add_high_mem = map_end - low_mem_end;
+            memory_map.map[i].size = low_mem_end - map_start;
+            break;
+        }
+    }
+
+    /* If we need to adjust highmem. */
+    if ( add_high_mem )
+    {
+        /* Modify the existing highmem region if it exists. */
+        for ( i = 0; i < memory_map.nr_map; i++ )
+        {
+            map_start = memory_map.map[i].addr;
+            map_size = memory_map.map[i].size;
+            map_end = map_start + map_size;
+
+            if ( memory_map.map[i].type == E820_RAM &&
+                 map_start == ((uint64_t)1 << 32))
+            {
+                memory_map.map[i].size += add_high_mem;
+                break;
+            }
+        }
+
+        /* If there was no highmem region, just create one. */
+        if ( i == memory_map.nr_map )
+        {
+            memory_map.map[i].addr = ((uint64_t)1 << 32);
+            memory_map.map[i].size = add_high_mem;
+            memory_map.map[i].type = E820_RAM;
+            memory_map.nr_map++;
+        }
+
+        /* A sanity check if high memory is broken. */
+        BUG_ON( high_mem_end !=
+                memory_map.map[i].addr + memory_map.map[i].size);
+    }
+
+    /* Now fill e820. */
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        e820[nr] = memory_map.map[i];
         nr++;
     }
 
+    /* Finally we need to sort all e820 entries. */
+    for ( j = 0; j < nr - 1; j++ )
+    {
+        for ( i = j + 1; i < nr; i++ )
+        {
+            if ( e820[j].addr > e820[i].addr )
+            {
+                struct e820entry tmp = e820[j];
+
+                e820[j] = e820[i];
+                e820[i] = tmp;
+            }
+        }
+    }
+
     return nr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUp-0005pu-3u; Fri, 31 Jul 2015 13:37: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 1ZLAUn-0005ph-L4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:09 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	0C/FF-00475-50A7BB55; Fri, 31 Jul 2015 13:37:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349827!30797174!1
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 22185 invoked from network); 31 Jul 2015 13:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:37:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUl-0004SH-1u
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUl-0006s7-0b
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:07 +0000
Date: Fri, 31 Jul 2015 13:37:07 +0000
Message-Id: <E1ZLAUl-0006s7-0b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Expose new hypercall
	xc_reserved_device_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 504ed2053362381ac01b98db9313454488b7db40
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools/libxc: Expose new hypercall xc_reserved_device_memory_map
    
    We will introduce the hypercall xc_reserved_device_memory_map
    approach to libxc. This helps us get rdm entry info according to
    different parameters. If flag == PCI_DEV_RDM_ALL, all entries
    should be exposed. Or we just expose that rdm entry specific to
    a SBDF.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    
    ---
    v13: Mechanical changes to deal with changes to patch 01/
         XENMEM_reserved_device_memory_map.
---
 tools/libxc/include/xenctrl.h |    8 ++++++++
 tools/libxc/xc_domain.c       |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index ce9029c..9c5ef8b 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1314,6 +1314,14 @@ int xc_domain_set_memory_map(xc_interface *xch,
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries);
+
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries);
 #endif
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 6db8d13..3151103 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -684,6 +684,42 @@ int xc_domain_set_memory_map(xc_interface *xch,
 
     return rc;
 }
+
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries)
+{
+    int rc;
+    struct xen_reserved_device_memory_map xrdmmap = {
+        .flags = flags,
+        .dev.pci.seg = seg,
+        .dev.pci.bus = bus,
+        .dev.pci.devfn = devfn,
+        .nr_entries = *max_entries
+    };
+    DECLARE_HYPERCALL_BOUNCE(entries,
+                             sizeof(struct xen_reserved_device_memory) *
+                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+    if ( xc_hypercall_bounce_pre(xch, entries) )
+        return -1;
+
+    set_xen_guest_handle(xrdmmap.buffer, entries);
+
+    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
+                      &xrdmmap, sizeof(xrdmmap));
+
+    xc_hypercall_bounce_post(xch, entries);
+
+    *max_entries = xrdmmap.nr_entries;
+
+    return rc;
+}
+
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_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 Fri Jul 31 13:37:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUp-0005pu-3u; Fri, 31 Jul 2015 13:37: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 1ZLAUn-0005ph-L4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:09 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	0C/FF-00475-50A7BB55; Fri, 31 Jul 2015 13:37:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1438349827!30797174!1
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 22185 invoked from network); 31 Jul 2015 13:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:37:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUl-0004SH-1u
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUl-0006s7-0b
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:07 +0000
Date: Fri, 31 Jul 2015 13:37:07 +0000
Message-Id: <E1ZLAUl-0006s7-0b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Expose new hypercall
	xc_reserved_device_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 504ed2053362381ac01b98db9313454488b7db40
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools/libxc: Expose new hypercall xc_reserved_device_memory_map
    
    We will introduce the hypercall xc_reserved_device_memory_map
    approach to libxc. This helps us get rdm entry info according to
    different parameters. If flag == PCI_DEV_RDM_ALL, all entries
    should be exposed. Or we just expose that rdm entry specific to
    a SBDF.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    
    ---
    v13: Mechanical changes to deal with changes to patch 01/
         XENMEM_reserved_device_memory_map.
---
 tools/libxc/include/xenctrl.h |    8 ++++++++
 tools/libxc/xc_domain.c       |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index ce9029c..9c5ef8b 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1314,6 +1314,14 @@ int xc_domain_set_memory_map(xc_interface *xch,
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries);
+
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries);
 #endif
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 6db8d13..3151103 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -684,6 +684,42 @@ int xc_domain_set_memory_map(xc_interface *xch,
 
     return rc;
 }
+
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries)
+{
+    int rc;
+    struct xen_reserved_device_memory_map xrdmmap = {
+        .flags = flags,
+        .dev.pci.seg = seg,
+        .dev.pci.bus = bus,
+        .dev.pci.devfn = devfn,
+        .nr_entries = *max_entries
+    };
+    DECLARE_HYPERCALL_BOUNCE(entries,
+                             sizeof(struct xen_reserved_device_memory) *
+                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+    if ( xc_hypercall_bounce_pre(xch, entries) )
+        return -1;
+
+    set_xen_guest_handle(xrdmmap.buffer, entries);
+
+    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
+                      &xrdmmap, sizeof(xrdmmap));
+
+    xc_hypercall_bounce_post(xch, entries);
+
+    *max_entries = xrdmmap.nr_entries;
+
+    return rc;
+}
+
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_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 Fri Jul 31 13:37:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUz-0005rl-8l; Fri, 31 Jul 2015 13:37: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 1ZLAUy-0005rT-7R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:20 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	91/8F-10422-F0A7BB55; Fri, 31 Jul 2015 13:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1438349837!24968132!1
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 19110 invoked from network); 31 Jul 2015 13:37:18 -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;
	31 Jul 2015 13:37:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUv-0004SP-IR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUv-0006sZ-9l
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:17 +0000
Date: Fri, 31 Jul 2015 13:37:17 +0000
Message-Id: <E1ZLAUv-0006sZ-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: extend xc_assign_device() to
	support rdm reservation policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b34056cb4cab826771dba031735f77a02df015c
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools: extend xc_assign_device() to support rdm reservation policy
    
    This patch passes rdm reservation policy to xc_assign_device() so the policy
    is checked when assigning devices to a VM.
    
    Note this also bring some fallout to python usage of xc_assign_device().
    
    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>
    CC: David Scott <dave.scott@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h       |    3 ++-
 tools/libxc/xc_domain.c             |    9 ++++++++-
 tools/libxl/libxl_pci.c             |    3 ++-
 tools/ocaml/libs/xc/xenctrl_stubs.c |   16 ++++++++++++----
 tools/python/xen/lowlevel/xc/xc.c   |   30 ++++++++++++++++++++----------
 5 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 9c5ef8b..3f2381a 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2067,7 +2067,8 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_sbdf);
+                     uint32_t machine_sbdf,
+                     uint32_t flag);
 
 int xc_get_device_group(xc_interface *xch,
                      uint32_t domid,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 3151103..df06314 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1697,7 +1697,8 @@ int xc_domain_setdebugging(xc_interface *xch,
 int xc_assign_device(
     xc_interface *xch,
     uint32_t domid,
-    uint32_t machine_sbdf)
+    uint32_t machine_sbdf,
+    uint32_t flag)
 {
     DECLARE_DOMCTL;
 
@@ -1705,6 +1706,7 @@ int xc_assign_device(
     domctl.domain = domid;
     domctl.u.assign_device.dev = XEN_DOMCTL_DEV_PCI;
     domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf;
+    domctl.u.assign_device.flag = flag;
 
     return do_domctl(xch, &domctl);
 }
@@ -1792,6 +1794,11 @@ int xc_assign_dt_device(
 
     domctl.u.assign_device.dev = XEN_DOMCTL_DEV_DT;
     domctl.u.assign_device.u.dt.size = size;
+    /*
+     * DT doesn't own any RDM so actually DT has nothing to do
+     * for any flag and here just fix that as 0.
+     */
+    domctl.u.assign_device.flag = 0;
     set_xen_guest_handle(domctl.u.assign_device.u.dt.path, path);
 
     rc = do_domctl(xch, &domctl);
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index e0743f8..632c15e 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -894,6 +894,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     FILE *f;
     unsigned long long start, end, flags, size;
     int irq, i, rc, hvm = 0;
+    uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
 
     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;
@@ -987,7 +988,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
 
 out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
-        rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
+        rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev), flag);
         if (rc < 0 && (hvm || errno != ENOSYS)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_assign_device failed");
             return ERROR_FAIL;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 64f1137..b7de615 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -1172,12 +1172,17 @@ CAMLprim value stub_xc_domain_test_assign_device(value xch, value domid, value d
 	CAMLreturn(Val_bool(ret == 0));
 }
 
-CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc)
+static int domain_assign_device_rdm_flag_table[] = {
+    XEN_DOMCTL_DEV_RDM_RELAXED,
+};
+
+CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc,
+                                            value rflag)
 {
-	CAMLparam3(xch, domid, desc);
+	CAMLparam4(xch, domid, desc, rflag);
 	int ret;
 	int domain, bus, dev, func;
-	uint32_t sbdf;
+	uint32_t sbdf, flag;
 
 	domain = Int_val(Field(desc, 0));
 	bus = Int_val(Field(desc, 1));
@@ -1185,7 +1190,10 @@ CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc)
 	func = Int_val(Field(desc, 3));
 	sbdf = encode_sbdf(domain, bus, dev, func);
 
-	ret = xc_assign_device(_H(xch), _D(domid), sbdf);
+	ret = Int_val(Field(rflag, 0));
+	flag = domain_assign_device_rdm_flag_table[ret];
+
+	ret = xc_assign_device(_H(xch), _D(domid), sbdf, flag);
 
 	if (ret < 0)
 		failwith_xc(_H(xch));
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index ee3e1d0..c8380d1 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -592,7 +592,8 @@ static int token_value(char *token)
     return strtol(token, NULL, 16);
 }
 
-static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
+static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
+                    int *flag)
 {
     char *token;
 
@@ -607,8 +608,17 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-    token = strchr(token, ',');
-    *str = token ? token + 1 : NULL;
+    token = strchr(token, ',') + 1;
+    if ( token ) {
+        *flag = token_value(token);
+        *str = token + 1;
+    }
+    else
+    {
+        /* O means we take "strict" as our default policy. */
+        *flag = 0;
+        *str = NULL;
+    }
 
     return 1;
 }
@@ -620,14 +630,14 @@ static PyObject *pyxc_test_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
@@ -653,21 +663,21 @@ static PyObject *pyxc_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
         sbdf |= (dev & 0x1f) << 3;
         sbdf |= (func & 0x7);
 
-        if ( xc_assign_device(self->xc_handle, dom, sbdf) != 0 )
+        if ( xc_assign_device(self->xc_handle, dom, sbdf, flag) != 0 )
         {
             if (errno == ENOSYS)
                 sbdf = -1;
@@ -686,14 +696,14 @@ static PyObject *pyxc_deassign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:37:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAUz-0005rl-8l; Fri, 31 Jul 2015 13:37: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 1ZLAUy-0005rT-7R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:20 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	91/8F-10422-F0A7BB55; Fri, 31 Jul 2015 13:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1438349837!24968132!1
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 19110 invoked from network); 31 Jul 2015 13:37:18 -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;
	31 Jul 2015 13:37:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUv-0004SP-IR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAUv-0006sZ-9l
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:17 +0000
Date: Fri, 31 Jul 2015 13:37:17 +0000
Message-Id: <E1ZLAUv-0006sZ-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: extend xc_assign_device() to
	support rdm reservation policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b34056cb4cab826771dba031735f77a02df015c
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools: extend xc_assign_device() to support rdm reservation policy
    
    This patch passes rdm reservation policy to xc_assign_device() so the policy
    is checked when assigning devices to a VM.
    
    Note this also bring some fallout to python usage of xc_assign_device().
    
    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>
    CC: David Scott <dave.scott@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h       |    3 ++-
 tools/libxc/xc_domain.c             |    9 ++++++++-
 tools/libxl/libxl_pci.c             |    3 ++-
 tools/ocaml/libs/xc/xenctrl_stubs.c |   16 ++++++++++++----
 tools/python/xen/lowlevel/xc/xc.c   |   30 ++++++++++++++++++++----------
 5 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 9c5ef8b..3f2381a 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2067,7 +2067,8 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_sbdf);
+                     uint32_t machine_sbdf,
+                     uint32_t flag);
 
 int xc_get_device_group(xc_interface *xch,
                      uint32_t domid,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 3151103..df06314 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1697,7 +1697,8 @@ int xc_domain_setdebugging(xc_interface *xch,
 int xc_assign_device(
     xc_interface *xch,
     uint32_t domid,
-    uint32_t machine_sbdf)
+    uint32_t machine_sbdf,
+    uint32_t flag)
 {
     DECLARE_DOMCTL;
 
@@ -1705,6 +1706,7 @@ int xc_assign_device(
     domctl.domain = domid;
     domctl.u.assign_device.dev = XEN_DOMCTL_DEV_PCI;
     domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf;
+    domctl.u.assign_device.flag = flag;
 
     return do_domctl(xch, &domctl);
 }
@@ -1792,6 +1794,11 @@ int xc_assign_dt_device(
 
     domctl.u.assign_device.dev = XEN_DOMCTL_DEV_DT;
     domctl.u.assign_device.u.dt.size = size;
+    /*
+     * DT doesn't own any RDM so actually DT has nothing to do
+     * for any flag and here just fix that as 0.
+     */
+    domctl.u.assign_device.flag = 0;
     set_xen_guest_handle(domctl.u.assign_device.u.dt.path, path);
 
     rc = do_domctl(xch, &domctl);
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index e0743f8..632c15e 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -894,6 +894,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     FILE *f;
     unsigned long long start, end, flags, size;
     int irq, i, rc, hvm = 0;
+    uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
 
     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;
@@ -987,7 +988,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
 
 out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
-        rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
+        rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev), flag);
         if (rc < 0 && (hvm || errno != ENOSYS)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_assign_device failed");
             return ERROR_FAIL;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 64f1137..b7de615 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -1172,12 +1172,17 @@ CAMLprim value stub_xc_domain_test_assign_device(value xch, value domid, value d
 	CAMLreturn(Val_bool(ret == 0));
 }
 
-CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc)
+static int domain_assign_device_rdm_flag_table[] = {
+    XEN_DOMCTL_DEV_RDM_RELAXED,
+};
+
+CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc,
+                                            value rflag)
 {
-	CAMLparam3(xch, domid, desc);
+	CAMLparam4(xch, domid, desc, rflag);
 	int ret;
 	int domain, bus, dev, func;
-	uint32_t sbdf;
+	uint32_t sbdf, flag;
 
 	domain = Int_val(Field(desc, 0));
 	bus = Int_val(Field(desc, 1));
@@ -1185,7 +1190,10 @@ CAMLprim value stub_xc_domain_assign_device(value xch, value domid, value desc)
 	func = Int_val(Field(desc, 3));
 	sbdf = encode_sbdf(domain, bus, dev, func);
 
-	ret = xc_assign_device(_H(xch), _D(domid), sbdf);
+	ret = Int_val(Field(rflag, 0));
+	flag = domain_assign_device_rdm_flag_table[ret];
+
+	ret = xc_assign_device(_H(xch), _D(domid), sbdf, flag);
 
 	if (ret < 0)
 		failwith_xc(_H(xch));
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index ee3e1d0..c8380d1 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -592,7 +592,8 @@ static int token_value(char *token)
     return strtol(token, NULL, 16);
 }
 
-static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
+static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
+                    int *flag)
 {
     char *token;
 
@@ -607,8 +608,17 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-    token = strchr(token, ',');
-    *str = token ? token + 1 : NULL;
+    token = strchr(token, ',') + 1;
+    if ( token ) {
+        *flag = token_value(token);
+        *str = token + 1;
+    }
+    else
+    {
+        /* O means we take "strict" as our default policy. */
+        *flag = 0;
+        *str = NULL;
+    }
 
     return 1;
 }
@@ -620,14 +630,14 @@ static PyObject *pyxc_test_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
@@ -653,21 +663,21 @@ static PyObject *pyxc_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
         sbdf |= (dev & 0x1f) << 3;
         sbdf |= (func & 0x7);
 
-        if ( xc_assign_device(self->xc_handle, dom, sbdf) != 0 )
+        if ( xc_assign_device(self->xc_handle, dom, sbdf, flag) != 0 )
         {
             if (errno == ENOSYS)
                 sbdf = -1;
@@ -686,14 +696,14 @@ static PyObject *pyxc_deassign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func;
+    int seg, bus, dev, func, flag;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:37:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVA-0005tL-BE; Fri, 31 Jul 2015 13:37: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 1ZLAV8-0005t8-Q1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AE/AB-05269-A1A7BB55; Fri, 31 Jul 2015 13:37:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438349847!31095449!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 12783 invoked from network); 31 Jul 2015 13:37:28 -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;
	31 Jul 2015 13:37:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAV5-0004SX-P0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAV5-0006tF-Na
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:27 +0000
Date: Fri, 31 Jul 2015 13:37:27 +0000
Message-Id: <E1ZLAV5-0006tF-Na@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: introduce some new parameters
	to set rdm policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63bc1398ad28a67a67ce156231a0bfa72608263d
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:50 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools: introduce some new parameters to set rdm policy
    
    This patch introduces user configurable parameters to specify RDM
    resource and according policies,
    
    Global RDM parameter:
        rdm = "strategy=host,policy=strict/relaxed"
    Per-device RDM parameter:
        pci = [ 'sbdf, rdm_policy=strict/relaxed' ]
    
    Global RDM parameter, "strategy", allows user to specify reserved regions
    explicitly, Currently, using 'host' to include all reserved regions reported
    on this platform which is good to handle hotplug scenario. In the future
    this parameter may be further extended to allow specifying random regions,
    e.g. even those belonging to another platform as a preparation for live
    migration with passthrough devices. By default this isn't set so we don't
    check all rdms. Instead, we just check rdm specific to a given device if
    you're assigning this kind of device. Note this option is not recommended
    unless you can make sure any conflict does exist.
    
    'strict/relaxed' policy decides how to handle conflict when reserving RDM
    regions in pfn space. If conflict exists, 'strict' means an immediate error
    so VM can't keep running, while 'relaxed' allows moving forward with a
    warning message thrown out.
    
    Default per-device RDM policy is same as default global RDM policy as being
    'relaxed'. And the per-device policy would override the global policy like
    others.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5        |   81 ++++++++++++++++++++++++++++++++++++++++++
 docs/misc/vtd.txt            |   24 ++++++++++++
 tools/libxl/libxl_create.c   |    7 ++++
 tools/libxl/libxl_internal.h |    2 +
 tools/libxl/libxl_pci.c      |    9 +++++
 tools/libxl/libxl_types.idl  |   18 +++++++++
 6 files changed, 141 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 382f30b..e6e0f70 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -633,6 +633,79 @@ assigned slave device.
 
 =back
 
+=item B<rdm="RDM_RESERVATION_STRING">
+
+(HVM/x86 only) Specifies information about Reserved Device Memory (RDM),
+which is necessary to enable robust device passthrough. One example of RDM
+is reported through ACPI Reserved Memory Region Reporting (RMRR) structure
+on x86 platform.
+
+B<RDM_RESERVE_STRING> has the form C<[KEY=VALUE,KEY=VALUE,...> where:
+
+=over 4
+
+=item B<KEY=VALUE>
+
+Possible B<KEY>s are:
+
+=over 4
+
+=item B<strategy="STRING">
+
+Currently there is only one valid type:
+
+"host" means all reserved device memory on this platform should be checked to
+reserve regions in this VM's guest address space. This global rdm parameter
+allows user to specify reserved regions explicitly, and using "host" includes
+all reserved regions reported on this platform, which is useful when doing
+hotplug.
+
+By default this isn't set so we don't check all rdms. Instead, we just check
+rdm specific to a given device if you're assigning this kind of device. Note
+this option is not recommended unless you can make sure any conflict does exist.
+
+For example, you're trying to set "memory = 2800" to allocate memory to one
+given VM but the platform owns two RDM regions like,
+
+Device A [sbdf_A]: RMRR region_A: base_addr ac6d3000 end_address ac6e6fff
+Device B [sbdf_B]: RMRR region_B: base_addr ad800000 end_address afffffff
+
+In this conflict case,
+
+#1. If B<strategy> is set to "host", for example,
+
+rdm = "strategy=host,policy=strict" or rdm = "strategy=host,policy=relaxed"
+
+It means all conflicts will be handled according to the policy
+introduced by B<policy> as described below.
+
+#2. If B<strategy> is not set at all, but
+
+pci = [ 'sbdf_A, rdm_policy=xxxxx' ]
+
+It means only one conflict of region_A will be handled according to the policy
+introduced by B<rdm_policy="STRING"> as described inside pci options.
+
+=item B<policy="STRING">
+
+Specifies how to deal with conflicts when reserving reserved device
+memory in guest address space.
+
+When that conflict is unsolved,
+
+"strict" means VM can't be created, or the associated device can't be
+attached in the case of hotplug.
+
+"relaxed" allows VM to be created but may cause VM to crash if
+pass-through device accesses RDM. For exampl,e Windows IGD GFX driver
+always accessed RDM regions so it leads to VM crash.
+
+Note this may be overridden by rdm_policy option in PCI device configuration.
+
+=back
+
+=back
+
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
 
 Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
@@ -695,6 +768,14 @@ dom0 without confirmation.  Please use with care.
 D0-D3hot power management states for the PCI device. False (0) by
 default.
 
+=item B<rdm_policy="STRING">
+
+(HVM/x86 only) This is same as policy option inside the rdm option but
+just specific to a given device. Therefore the default is "relaxed" as
+same as policy option as well.
+
+Note this would override global B<rdm> option.
+
 =back
 
 =back
diff --git a/docs/misc/vtd.txt b/docs/misc/vtd.txt
index 9af0e99..88b2102 100644
--- a/docs/misc/vtd.txt
+++ b/docs/misc/vtd.txt
@@ -111,6 +111,30 @@ in the config file:
 To override for a specific device:
 	pci = [ '01:00.0,msitranslate=0', '03:00.0' ]
 
+RDM, 'reserved device memory', for PCI Device Passthrough
+---------------------------------------------------------
+
+There are some devices the BIOS controls, for e.g. USB devices to perform
+PS2 emulation. The regions of memory used for these devices are marked
+reserved in the e820 map. When we turn on DMA translation, DMA to those
+regions will fail. Hence BIOS uses RMRR to specify these regions along with
+devices that need to access these regions. OS is expected to setup
+identity mappings for these regions for these devices to access these regions.
+
+While creating a VM we should reserve them in advance, and avoid any conflicts.
+So we introduce user configurable parameters to specify RDM resource and
+according policies,
+
+To enable this globally, add "rdm" in the config file:
+
+    rdm = "strategy=host, policy=relaxed"   (default policy is "relaxed")
+
+Or just for a specific device:
+
+    pci = [ '01:00.0,rdm_policy=relaxed', '03:00.0,rdm_policy=strict' ]
+
+For all the options available to RDM, see xl.cfg(5).
+
 
 Caveat on Conventional PCI Device Passthrough
 ---------------------------------------------
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a32e3df..7c884c4 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -50,6 +50,12 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
     return 0;
 }
 
+void libxl__rdm_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info)
+{
+    if (b_info->u.hvm.rdm.policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+        b_info->u.hvm.rdm.policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+}
+
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
@@ -332,6 +338,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
         libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
 
+        libxl__rdm_setdefault(gc, b_info);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 3c09668..4bb0f38 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1176,6 +1176,8 @@ _hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
+_hidden void libxl__rdm_setdefault(libxl__gc *gc,
+                                   libxl_domain_build_info *b_info);
 
 _hidden const char *libxl__device_nic_devname(libxl__gc *gc,
                                               uint32_t domid,
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 632c15e..1ebdce7 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -988,6 +988,12 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
 
 out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
+        if (pcidev->rdm_policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
+            flag &= ~XEN_DOMCTL_DEV_RDM_RELAXED;
+        } else if (pcidev->rdm_policy != LIBXL_RDM_RESERVE_POLICY_RELAXED) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown rdm check flag.");
+            return ERROR_FAIL;
+        }
         rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev), flag);
         if (rc < 0 && (hvm || errno != ENOSYS)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_assign_device failed");
@@ -1040,6 +1046,9 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
 
 int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
 {
+    /* We'd like to force reserve rdm specific to a device by default.*/
+    if (pci->rdm_policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+        pci->rdm_policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
     return 0;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index bc0c4ef..db9f75a 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -77,6 +77,17 @@ libxl_domain_type = Enumeration("domain_type", [
     (2, "PV"),
     ], init_val = "LIBXL_DOMAIN_TYPE_INVALID")
 
+libxl_rdm_reserve_strategy = Enumeration("rdm_reserve_strategy", [
+    (0, "ignore"),
+    (1, "host"),
+    ])
+
+libxl_rdm_reserve_policy = Enumeration("rdm_reserve_policy", [
+    (-1, "invalid"),
+    (0, "strict"),
+    (1, "relaxed"),
+    ], init_val = "LIBXL_RDM_RESERVE_POLICY_INVALID")
+
 libxl_channel_connection = Enumeration("channel_connection", [
     (0, "UNKNOWN"),
     (1, "PTY"),
@@ -387,6 +398,11 @@ libxl_gic_version = Enumeration("gic_version", [
     (0x30, "v3")
     ], init_val = "LIBXL_GIC_VERSION_DEFAULT")
 
+libxl_rdm_reserve = Struct("rdm_reserve", [
+    ("strategy",    libxl_rdm_reserve_strategy),
+    ("policy",      libxl_rdm_reserve_policy),
+    ])
+
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("avail_vcpus",     libxl_bitmap),
@@ -486,6 +502,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        # See libxl_ms_vm_genid_generate()
                                        ("ms_vm_genid",      libxl_ms_vm_genid),
                                        ("serial_list",      libxl_string_list),
+                                       ("rdm", libxl_rdm_reserve),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
@@ -566,6 +583,7 @@ libxl_device_pci = Struct("device_pci", [
     ("power_mgmt", bool),
     ("permissive", bool),
     ("seize", bool),
+    ("rdm_policy",      libxl_rdm_reserve_policy),
     ])
 
 libxl_device_dtdev = Struct("device_dtdev", [
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVA-0005tL-BE; Fri, 31 Jul 2015 13:37: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 1ZLAV8-0005t8-Q1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AE/AB-05269-A1A7BB55; Fri, 31 Jul 2015 13:37:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438349847!31095449!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 12783 invoked from network); 31 Jul 2015 13:37:28 -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;
	31 Jul 2015 13:37:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAV5-0004SX-P0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAV5-0006tF-Na
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:27 +0000
Date: Fri, 31 Jul 2015 13:37:27 +0000
Message-Id: <E1ZLAV5-0006tF-Na@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: introduce some new parameters
	to set rdm policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63bc1398ad28a67a67ce156231a0bfa72608263d
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:50 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools: introduce some new parameters to set rdm policy
    
    This patch introduces user configurable parameters to specify RDM
    resource and according policies,
    
    Global RDM parameter:
        rdm = "strategy=host,policy=strict/relaxed"
    Per-device RDM parameter:
        pci = [ 'sbdf, rdm_policy=strict/relaxed' ]
    
    Global RDM parameter, "strategy", allows user to specify reserved regions
    explicitly, Currently, using 'host' to include all reserved regions reported
    on this platform which is good to handle hotplug scenario. In the future
    this parameter may be further extended to allow specifying random regions,
    e.g. even those belonging to another platform as a preparation for live
    migration with passthrough devices. By default this isn't set so we don't
    check all rdms. Instead, we just check rdm specific to a given device if
    you're assigning this kind of device. Note this option is not recommended
    unless you can make sure any conflict does exist.
    
    'strict/relaxed' policy decides how to handle conflict when reserving RDM
    regions in pfn space. If conflict exists, 'strict' means an immediate error
    so VM can't keep running, while 'relaxed' allows moving forward with a
    warning message thrown out.
    
    Default per-device RDM policy is same as default global RDM policy as being
    'relaxed'. And the per-device policy would override the global policy like
    others.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5        |   81 ++++++++++++++++++++++++++++++++++++++++++
 docs/misc/vtd.txt            |   24 ++++++++++++
 tools/libxl/libxl_create.c   |    7 ++++
 tools/libxl/libxl_internal.h |    2 +
 tools/libxl/libxl_pci.c      |    9 +++++
 tools/libxl/libxl_types.idl  |   18 +++++++++
 6 files changed, 141 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 382f30b..e6e0f70 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -633,6 +633,79 @@ assigned slave device.
 
 =back
 
+=item B<rdm="RDM_RESERVATION_STRING">
+
+(HVM/x86 only) Specifies information about Reserved Device Memory (RDM),
+which is necessary to enable robust device passthrough. One example of RDM
+is reported through ACPI Reserved Memory Region Reporting (RMRR) structure
+on x86 platform.
+
+B<RDM_RESERVE_STRING> has the form C<[KEY=VALUE,KEY=VALUE,...> where:
+
+=over 4
+
+=item B<KEY=VALUE>
+
+Possible B<KEY>s are:
+
+=over 4
+
+=item B<strategy="STRING">
+
+Currently there is only one valid type:
+
+"host" means all reserved device memory on this platform should be checked to
+reserve regions in this VM's guest address space. This global rdm parameter
+allows user to specify reserved regions explicitly, and using "host" includes
+all reserved regions reported on this platform, which is useful when doing
+hotplug.
+
+By default this isn't set so we don't check all rdms. Instead, we just check
+rdm specific to a given device if you're assigning this kind of device. Note
+this option is not recommended unless you can make sure any conflict does exist.
+
+For example, you're trying to set "memory = 2800" to allocate memory to one
+given VM but the platform owns two RDM regions like,
+
+Device A [sbdf_A]: RMRR region_A: base_addr ac6d3000 end_address ac6e6fff
+Device B [sbdf_B]: RMRR region_B: base_addr ad800000 end_address afffffff
+
+In this conflict case,
+
+#1. If B<strategy> is set to "host", for example,
+
+rdm = "strategy=host,policy=strict" or rdm = "strategy=host,policy=relaxed"
+
+It means all conflicts will be handled according to the policy
+introduced by B<policy> as described below.
+
+#2. If B<strategy> is not set at all, but
+
+pci = [ 'sbdf_A, rdm_policy=xxxxx' ]
+
+It means only one conflict of region_A will be handled according to the policy
+introduced by B<rdm_policy="STRING"> as described inside pci options.
+
+=item B<policy="STRING">
+
+Specifies how to deal with conflicts when reserving reserved device
+memory in guest address space.
+
+When that conflict is unsolved,
+
+"strict" means VM can't be created, or the associated device can't be
+attached in the case of hotplug.
+
+"relaxed" allows VM to be created but may cause VM to crash if
+pass-through device accesses RDM. For exampl,e Windows IGD GFX driver
+always accessed RDM regions so it leads to VM crash.
+
+Note this may be overridden by rdm_policy option in PCI device configuration.
+
+=back
+
+=back
+
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
 
 Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
@@ -695,6 +768,14 @@ dom0 without confirmation.  Please use with care.
 D0-D3hot power management states for the PCI device. False (0) by
 default.
 
+=item B<rdm_policy="STRING">
+
+(HVM/x86 only) This is same as policy option inside the rdm option but
+just specific to a given device. Therefore the default is "relaxed" as
+same as policy option as well.
+
+Note this would override global B<rdm> option.
+
 =back
 
 =back
diff --git a/docs/misc/vtd.txt b/docs/misc/vtd.txt
index 9af0e99..88b2102 100644
--- a/docs/misc/vtd.txt
+++ b/docs/misc/vtd.txt
@@ -111,6 +111,30 @@ in the config file:
 To override for a specific device:
 	pci = [ '01:00.0,msitranslate=0', '03:00.0' ]
 
+RDM, 'reserved device memory', for PCI Device Passthrough
+---------------------------------------------------------
+
+There are some devices the BIOS controls, for e.g. USB devices to perform
+PS2 emulation. The regions of memory used for these devices are marked
+reserved in the e820 map. When we turn on DMA translation, DMA to those
+regions will fail. Hence BIOS uses RMRR to specify these regions along with
+devices that need to access these regions. OS is expected to setup
+identity mappings for these regions for these devices to access these regions.
+
+While creating a VM we should reserve them in advance, and avoid any conflicts.
+So we introduce user configurable parameters to specify RDM resource and
+according policies,
+
+To enable this globally, add "rdm" in the config file:
+
+    rdm = "strategy=host, policy=relaxed"   (default policy is "relaxed")
+
+Or just for a specific device:
+
+    pci = [ '01:00.0,rdm_policy=relaxed', '03:00.0,rdm_policy=strict' ]
+
+For all the options available to RDM, see xl.cfg(5).
+
 
 Caveat on Conventional PCI Device Passthrough
 ---------------------------------------------
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a32e3df..7c884c4 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -50,6 +50,12 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
     return 0;
 }
 
+void libxl__rdm_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info)
+{
+    if (b_info->u.hvm.rdm.policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+        b_info->u.hvm.rdm.policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+}
+
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
@@ -332,6 +338,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
         libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
 
+        libxl__rdm_setdefault(gc, b_info);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 3c09668..4bb0f38 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1176,6 +1176,8 @@ _hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
+_hidden void libxl__rdm_setdefault(libxl__gc *gc,
+                                   libxl_domain_build_info *b_info);
 
 _hidden const char *libxl__device_nic_devname(libxl__gc *gc,
                                               uint32_t domid,
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 632c15e..1ebdce7 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -988,6 +988,12 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
 
 out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
+        if (pcidev->rdm_policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
+            flag &= ~XEN_DOMCTL_DEV_RDM_RELAXED;
+        } else if (pcidev->rdm_policy != LIBXL_RDM_RESERVE_POLICY_RELAXED) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown rdm check flag.");
+            return ERROR_FAIL;
+        }
         rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev), flag);
         if (rc < 0 && (hvm || errno != ENOSYS)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_assign_device failed");
@@ -1040,6 +1046,9 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
 
 int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
 {
+    /* We'd like to force reserve rdm specific to a device by default.*/
+    if (pci->rdm_policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+        pci->rdm_policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
     return 0;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index bc0c4ef..db9f75a 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -77,6 +77,17 @@ libxl_domain_type = Enumeration("domain_type", [
     (2, "PV"),
     ], init_val = "LIBXL_DOMAIN_TYPE_INVALID")
 
+libxl_rdm_reserve_strategy = Enumeration("rdm_reserve_strategy", [
+    (0, "ignore"),
+    (1, "host"),
+    ])
+
+libxl_rdm_reserve_policy = Enumeration("rdm_reserve_policy", [
+    (-1, "invalid"),
+    (0, "strict"),
+    (1, "relaxed"),
+    ], init_val = "LIBXL_RDM_RESERVE_POLICY_INVALID")
+
 libxl_channel_connection = Enumeration("channel_connection", [
     (0, "UNKNOWN"),
     (1, "PTY"),
@@ -387,6 +398,11 @@ libxl_gic_version = Enumeration("gic_version", [
     (0x30, "v3")
     ], init_val = "LIBXL_GIC_VERSION_DEFAULT")
 
+libxl_rdm_reserve = Struct("rdm_reserve", [
+    ("strategy",    libxl_rdm_reserve_strategy),
+    ("policy",      libxl_rdm_reserve_policy),
+    ])
+
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("avail_vcpus",     libxl_bitmap),
@@ -486,6 +502,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        # See libxl_ms_vm_genid_generate()
                                        ("ms_vm_genid",      libxl_ms_vm_genid),
                                        ("serial_list",      libxl_string_list),
+                                       ("rdm", libxl_rdm_reserve),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
@@ -566,6 +583,7 @@ libxl_device_pci = Struct("device_pci", [
     ("power_mgmt", bool),
     ("permissive", bool),
     ("seize", bool),
+    ("rdm_policy",      libxl_rdm_reserve_policy),
     ])
 
 libxl_device_dtdev = Struct("device_dtdev", [
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVL-0005ui-EB; Fri, 31 Jul 2015 13:37: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 1ZLAVJ-0005uS-Cu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:41 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	34/5C-09570-42A7BB55; Fri, 31 Jul 2015 13:37:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349858!30994831!1
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 17924 invoked from network); 31 Jul 2015 13:37:39 -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;
	31 Jul 2015 13:37:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVF-0004Sf-Um
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVF-0006uD-TP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:37 +0000
Date: Fri, 31 Jul 2015 13:37:37 +0000
Message-Id: <E1ZLAVF-0006uD-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: detect and avoid
	conflicts with RDM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 25652f232cbee8f4c6c740c86e9f12b45fa655e9
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:07 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools/libxl: detect and avoid conflicts with RDM
    
    While building a VM, HVM domain builder provides struct hvm_info_table{}
    to help hvmloader. Currently it includes two fields to construct guest
    e820 table by hvmloader, low_mem_pgend and high_mem_pgend. So we should
    check them to fix any conflict with RDM.
    
    RMRR can reside in address space beyond 4G theoretically, but we never
    see this in real world. So in order to avoid breaking highmem layout
    we don't solve highmem conflict. Note this means highmem rmrr could still
    be supported if no conflict.
    
    But in the case of lowmem, RMRR probably scatter the whole RAM space.
    Especially multiple RMRR entries would worsen this to lead a complicated
    memory layout. And then its hard to extend hvm_info_table{} to work
    hvmloader out. So here we're trying to figure out a simple solution to
    avoid breaking existing layout. So when a conflict occurs,
    
        #1. Above a predefined boundary (2G)
            - move lowmem_end below reserved region to solve conflict;
    
        #2. Below a predefined boundary (2G)
            - Check strict/relaxed policy.
            "strict" policy leads to fail libxl. Note when both policies
            are specified on a given region, 'strict' is always preferred.
            "relaxed" policy issue a warning message and also mask this entry INVALID
            to indicate we shouldn't expose this entry to hvmloader.
    
    Note later we need to provide a parameter to set that predefined boundary
    dynamically.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    
    ---
    v13a: Change `flag' to `flags' in libxl__xc_device_get_rdm.
         No functional change.  [ Suggested by Tiejun Chen. ]
    v13: Mechanical changes to deal with changes to patch 01/
         XENMEM_reserved_device_memory_map.
---
 tools/libxl/libxl_create.c   |    2 +-
 tools/libxl/libxl_dm.c       |  274 ++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_dom.c      |   17 +++-
 tools/libxl/libxl_internal.h |   14 ++-
 tools/libxl/libxl_types.idl  |    7 +
 5 files changed, 311 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 7c884c4..5b57062 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -407,7 +407,7 @@ int libxl__domain_build(libxl__gc *gc,
 
     switch (info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        ret = libxl__build_hvm(gc, domid, info, state);
+        ret = libxl__build_hvm(gc, domid, d_config, state);
         if (ret)
             goto out;
 
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 634b8d2..8d103c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -92,6 +92,280 @@ const char *libxl__domain_device_model(libxl__gc *gc,
     return dm;
 }
 
+static int
+libxl__xc_device_get_rdm(libxl__gc *gc,
+                         uint32_t flags,
+                         uint16_t seg,
+                         uint8_t bus,
+                         uint8_t devfn,
+                         unsigned int *nr_entries,
+                         struct xen_reserved_device_memory **xrdm)
+{
+    int rc = 0, r;
+
+    /*
+     * We really can't presume how many entries we can get in advance.
+     */
+    *nr_entries = 0;
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
+                                      NULL, nr_entries);
+    assert(r <= 0);
+    /* "0" means we have no any rdm entry. */
+    if (!r) goto out;
+
+    if (errno != ENOBUFS) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    GCNEW_ARRAY(*xrdm, *nr_entries);
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
+                                      *xrdm, nr_entries);
+    if (r)
+        rc = ERROR_FAIL;
+
+ out:
+    if (rc) {
+        *nr_entries = 0;
+        *xrdm = NULL;
+        LOG(ERROR, "Could not get reserved device memory maps.\n");
+    }
+    return rc;
+}
+
+/*
+ * Check whether there exists rdm hole in the specified memory range.
+ * Returns true if exists, else returns false.
+ */
+static bool overlaps_rdm(uint64_t start, uint64_t memsize,
+                         uint64_t rdm_start, uint64_t rdm_size)
+{
+    return (start + memsize > rdm_start) && (start < rdm_start + rdm_size);
+}
+
+static void
+add_rdm_entry(libxl__gc *gc, libxl_domain_config *d_config,
+              uint64_t rdm_start, uint64_t rdm_size, int rdm_policy)
+{
+    d_config->rdms = libxl__realloc(NOGC, d_config->rdms,
+                    (d_config->num_rdms+1) * sizeof(libxl_device_rdm));
+
+    d_config->rdms[d_config->num_rdms].start = rdm_start;
+    d_config->rdms[d_config->num_rdms].size = rdm_size;
+    d_config->rdms[d_config->num_rdms].policy = rdm_policy;
+    d_config->num_rdms++;
+}
+
+/*
+ * Check reported RDM regions and handle potential gfn conflicts according
+ * to user preferred policy.
+ *
+ * RDM can reside in address space beyond 4G theoretically, but we never
+ * see this in real world. So in order to avoid breaking highmem layout
+ * we don't solve highmem conflict. Note this means highmem rmrr could
+ * still be supported if no conflict.
+ *
+ * But in the case of lowmem, RDM probably scatter the whole RAM space.
+ * Especially multiple RDM entries would worsen this to lead a complicated
+ * memory layout. And then its hard to extend hvm_info_table{} to work
+ * hvmloader out. So here we're trying to figure out a simple solution to
+ * avoid breaking existing layout. So when a conflict occurs,
+ *
+ * #1. Above a predefined boundary (default 2G)
+ * - Move lowmem_end below reserved region to solve conflict;
+ *
+ * #2. Below a predefined boundary (default 2G)
+ * - Check strict/relaxed policy.
+ * "strict" policy leads to fail libxl.
+ * "relaxed" policy issue a warning message and also mask this entry
+ * INVALID to indicate we shouldn't expose this entry to hvmloader.
+ * Note when both policies are specified on a given region, the per-device
+ * policy should override the global policy.
+ */
+int libxl__domain_device_construct_rdm(libxl__gc *gc,
+                                       libxl_domain_config *d_config,
+                                       uint64_t rdm_mem_boundary,
+                                       struct xc_hvm_build_args *args)
+{
+    int i, j, conflict, rc;
+    struct xen_reserved_device_memory *xrdm = NULL;
+    uint32_t strategy = d_config->b_info.u.hvm.rdm.strategy;
+    uint16_t seg;
+    uint8_t bus, devfn;
+    uint64_t rdm_start, rdm_size;
+    uint64_t highmem_end = args->highmem_end ? args->highmem_end : (1ull<<32);
+
+    /*
+     * We just want to construct RDM once since RDM is specific to the
+     * given platform, so this shouldn't change again.
+     */
+    if (d_config->num_rdms)
+        return 0;
+
+    /* Might not expose rdm. */
+    if (strategy == LIBXL_RDM_RESERVE_STRATEGY_IGNORE &&
+        !d_config->num_pcidevs)
+        return 0;
+
+    /* Query all RDM entries in this platform */
+    if (strategy == LIBXL_RDM_RESERVE_STRATEGY_HOST) {
+        unsigned int nr_entries;
+
+        /* Collect all rdm info if exist. */
+        rc = libxl__xc_device_get_rdm(gc, XENMEM_RDM_ALL,
+                                      0, 0, 0, &nr_entries, &xrdm);
+        if (rc)
+            goto out;
+        if (!nr_entries)
+            return 0;
+
+        assert(xrdm);
+
+        for (i = 0; i < nr_entries; i++)
+        {
+            add_rdm_entry(gc, d_config,
+                          pfn_to_paddr(xrdm[i].start_pfn),
+                          pfn_to_paddr(xrdm[i].nr_pages),
+                          d_config->b_info.u.hvm.rdm.policy);
+        }
+    }
+
+    /* Query RDM entries per-device */
+    for (i = 0; i < d_config->num_pcidevs; i++) {
+        unsigned int nr_entries;
+        bool new = true;
+
+        seg = d_config->pcidevs[i].domain;
+        bus = d_config->pcidevs[i].bus;
+        devfn = PCI_DEVFN(d_config->pcidevs[i].dev,
+                          d_config->pcidevs[i].func);
+        nr_entries = 0;
+        rc = libxl__xc_device_get_rdm(gc, 0,
+                                      seg, bus, devfn, &nr_entries, &xrdm);
+        if (rc)
+            goto out;
+        /* No RDM to associated with this device. */
+        if (!nr_entries)
+            continue;
+
+        assert(xrdm);
+
+        /*
+         * Need to check whether this entry is already saved in the array.
+         * This could come from two cases:
+         *
+         *   - user may configure to get all RDMs in this platform, which
+         *   is already queried before this point
+         *   - or two assigned devices may share one RDM entry
+         *
+         * Different policies may be configured on the same RDM due to
+         * above two cases. But we don't allow to assign such a group
+         * devies right now so it doesn't come true in our case.
+         */
+        for (j = 0; j < d_config->num_rdms; j++) {
+            if (d_config->rdms[j].start == pfn_to_paddr(xrdm[0].start_pfn))
+            {
+                /*
+                 * So the per-device policy always override the global
+                 * policy in this case.
+                 */
+                d_config->rdms[j].policy = d_config->pcidevs[i].rdm_policy;
+                new = false;
+                break;
+            }
+        }
+
+        if (new) {
+            add_rdm_entry(gc, d_config,
+                          pfn_to_paddr(xrdm[0].start_pfn),
+                          pfn_to_paddr(xrdm[0].nr_pages),
+                          d_config->pcidevs[i].rdm_policy);
+        }
+    }
+
+    /*
+     * Next step is to check and avoid potential conflict between RDM
+     * entries and guest RAM. To avoid intrusive impact to existing
+     * memory layout {lowmem, mmio, highmem} which is passed around
+     * various function blocks, below conflicts are not handled which
+     * are rare and handling them would lead to a more scattered
+     * layout:
+     *  - RDM  in highmem area (>4G)
+     *  - RDM lower than a defined memory boundary (e.g. 2G)
+     * Otherwise for conflicts between boundary and 4G, we'll simply
+     * move lowmem end below reserved region to solve conflict.
+     *
+     * If a conflict is detected on a given RDM entry, an error will
+     * be returned if 'strict' policy is specified. Instead, if
+     * 'relaxed' policy specified, this conflict is treated just as a
+     * warning, but we mark this RDM entry as INVALID to indicate that
+     * this entry shouldn't be exposed to hvmloader.
+     *
+     * Firstly we should check the case of rdm < 4G because we may
+     * need to expand highmem_end.
+     */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        rdm_start = d_config->rdms[i].start;
+        rdm_size = d_config->rdms[i].size;
+        conflict = overlaps_rdm(0, args->lowmem_end, rdm_start, rdm_size);
+
+        if (!conflict)
+            continue;
+
+        /* Just check if RDM > our memory boundary. */
+        if (rdm_start > rdm_mem_boundary) {
+            /*
+             * We will move downwards lowmem_end so we have to expand
+             * highmem_end.
+             */
+            highmem_end += (args->lowmem_end - rdm_start);
+            /* Now move downwards lowmem_end. */
+            args->lowmem_end = rdm_start;
+        }
+    }
+
+    /* Sync highmem_end. */
+    args->highmem_end = highmem_end;
+
+    /*
+     * Finally we can take same policy to check lowmem(< 2G) and
+     * highmem adjusted above.
+     */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        rdm_start = d_config->rdms[i].start;
+        rdm_size = d_config->rdms[i].size;
+        /* Does this entry conflict with lowmem? */
+        conflict = overlaps_rdm(0, args->lowmem_end,
+                                rdm_start, rdm_size);
+        /* Does this entry conflict with highmem? */
+        conflict |= overlaps_rdm((1ULL<<32),
+                                 args->highmem_end - (1ULL<<32),
+                                 rdm_start, rdm_size);
+
+        if (!conflict)
+            continue;
+
+        if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
+            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            goto out;
+        } else {
+            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+                      d_config->rdms[i].start);
+
+            /*
+             * Then mask this INVALID to indicate we shouldn't expose this
+             * to hvmloader.
+             */
+            d_config->rdms[i].policy = LIBXL_RDM_RESERVE_POLICY_INVALID;
+        }
+    }
+
+    return 0;
+
+ out:
+    return ERROR_FAIL;
+}
+
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index edd7f3f..9af3b21 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -922,13 +922,20 @@ out:
 }
 
 int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info,
+              libxl_domain_config *d_config,
               libxl__domain_build_state *state)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     struct xc_hvm_build_args args = {};
     int ret, rc = ERROR_FAIL;
     uint64_t mmio_start, lowmem_end, highmem_end;
+    libxl_domain_build_info *const info = &d_config->b_info;
+    /*
+     * Currently we fix this as 2G to guarantee how to handle
+     * our rdm policy. But we'll provide a parameter to set
+     * this dynamically.
+     */
+    uint64_t rdm_mem_boundary = 0x80000000;
 
     memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
@@ -966,6 +973,14 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.highmem_end = highmem_end;
     args.mmio_start = mmio_start;
 
+    rc = libxl__domain_device_construct_rdm(gc, d_config,
+                                            rdm_mem_boundary,
+                                            &args);
+    if (rc) {
+        LOG(ERROR, "checking reserved device memory failed");
+        goto out;
+    }
+
     if (info->num_vnuma_nodes != 0) {
         int i;
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 4bb0f38..f2466dc 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -144,6 +144,9 @@
 #endif
   /* all of these macros preserve errno (saving and restoring) */
 
+/* Convert pfn to physical address space. */
+#define pfn_to_paddr(x) ((uint64_t)(x) << XC_PAGE_SHIFT)
+
 /* logging */
 _hidden void libxl__logv(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
              const char *file /* may be 0 */, int line /* ignored if !file */,
@@ -1079,7 +1082,7 @@ _hidden int libxl__build_post(libxl__gc *gc, uint32_t domid,
 _hidden int libxl__build_pv(libxl__gc *gc, uint32_t domid,
              libxl_domain_build_info *info, libxl__domain_build_state *state);
 _hidden int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info,
+              libxl_domain_config *d_config,
               libxl__domain_build_state *state);
 
 _hidden int libxl__qemu_traditional_cmd(libxl__gc *gc, uint32_t domid,
@@ -1587,6 +1590,15 @@ _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_channels, libxl_device_channel *channels);
 
 /*
+ * This function will fix reserved device memory conflict
+ * according to user's configuration.
+ */
+_hidden int libxl__domain_device_construct_rdm(libxl__gc *gc,
+                                   libxl_domain_config *d_config,
+                                   uint64_t rdm_mem_guard,
+                                   struct xc_hvm_build_args *args);
+
+/*
  * This function will cause the whole libxl process to hang
  * if the device model does not respond.  It is deprecated.
  *
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index db9f75a..157fa59 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -586,6 +586,12 @@ libxl_device_pci = Struct("device_pci", [
     ("rdm_policy",      libxl_rdm_reserve_policy),
     ])
 
+libxl_device_rdm = Struct("device_rdm", [
+    ("start", uint64),
+    ("size", uint64),
+    ("policy", libxl_rdm_reserve_policy),
+    ])
+
 libxl_device_dtdev = Struct("device_dtdev", [
     ("path", string),
     ])
@@ -616,6 +622,7 @@ libxl_domain_config = Struct("domain_config", [
     ("disks", Array(libxl_device_disk, "num_disks")),
     ("nics", Array(libxl_device_nic, "num_nics")),
     ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("rdms", Array(libxl_device_rdm, "num_rdms")),
     ("dtdevs", Array(libxl_device_dtdev, "num_dtdevs")),
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVL-0005ui-EB; Fri, 31 Jul 2015 13:37: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 1ZLAVJ-0005uS-Cu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:41 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	34/5C-09570-42A7BB55; Fri, 31 Jul 2015 13:37:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349858!30994831!1
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 17924 invoked from network); 31 Jul 2015 13:37:39 -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;
	31 Jul 2015 13:37:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVF-0004Sf-Um
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVF-0006uD-TP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:37 +0000
Date: Fri, 31 Jul 2015 13:37:37 +0000
Message-Id: <E1ZLAVF-0006uD-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: detect and avoid
	conflicts with RDM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 25652f232cbee8f4c6c740c86e9f12b45fa655e9
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:07 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:25 2015 +0100

    tools/libxl: detect and avoid conflicts with RDM
    
    While building a VM, HVM domain builder provides struct hvm_info_table{}
    to help hvmloader. Currently it includes two fields to construct guest
    e820 table by hvmloader, low_mem_pgend and high_mem_pgend. So we should
    check them to fix any conflict with RDM.
    
    RMRR can reside in address space beyond 4G theoretically, but we never
    see this in real world. So in order to avoid breaking highmem layout
    we don't solve highmem conflict. Note this means highmem rmrr could still
    be supported if no conflict.
    
    But in the case of lowmem, RMRR probably scatter the whole RAM space.
    Especially multiple RMRR entries would worsen this to lead a complicated
    memory layout. And then its hard to extend hvm_info_table{} to work
    hvmloader out. So here we're trying to figure out a simple solution to
    avoid breaking existing layout. So when a conflict occurs,
    
        #1. Above a predefined boundary (2G)
            - move lowmem_end below reserved region to solve conflict;
    
        #2. Below a predefined boundary (2G)
            - Check strict/relaxed policy.
            "strict" policy leads to fail libxl. Note when both policies
            are specified on a given region, 'strict' is always preferred.
            "relaxed" policy issue a warning message and also mask this entry INVALID
            to indicate we shouldn't expose this entry to hvmloader.
    
    Note later we need to provide a parameter to set that predefined boundary
    dynamically.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    
    ---
    v13a: Change `flag' to `flags' in libxl__xc_device_get_rdm.
         No functional change.  [ Suggested by Tiejun Chen. ]
    v13: Mechanical changes to deal with changes to patch 01/
         XENMEM_reserved_device_memory_map.
---
 tools/libxl/libxl_create.c   |    2 +-
 tools/libxl/libxl_dm.c       |  274 ++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_dom.c      |   17 +++-
 tools/libxl/libxl_internal.h |   14 ++-
 tools/libxl/libxl_types.idl  |    7 +
 5 files changed, 311 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 7c884c4..5b57062 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -407,7 +407,7 @@ int libxl__domain_build(libxl__gc *gc,
 
     switch (info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        ret = libxl__build_hvm(gc, domid, info, state);
+        ret = libxl__build_hvm(gc, domid, d_config, state);
         if (ret)
             goto out;
 
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 634b8d2..8d103c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -92,6 +92,280 @@ const char *libxl__domain_device_model(libxl__gc *gc,
     return dm;
 }
 
+static int
+libxl__xc_device_get_rdm(libxl__gc *gc,
+                         uint32_t flags,
+                         uint16_t seg,
+                         uint8_t bus,
+                         uint8_t devfn,
+                         unsigned int *nr_entries,
+                         struct xen_reserved_device_memory **xrdm)
+{
+    int rc = 0, r;
+
+    /*
+     * We really can't presume how many entries we can get in advance.
+     */
+    *nr_entries = 0;
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
+                                      NULL, nr_entries);
+    assert(r <= 0);
+    /* "0" means we have no any rdm entry. */
+    if (!r) goto out;
+
+    if (errno != ENOBUFS) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    GCNEW_ARRAY(*xrdm, *nr_entries);
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
+                                      *xrdm, nr_entries);
+    if (r)
+        rc = ERROR_FAIL;
+
+ out:
+    if (rc) {
+        *nr_entries = 0;
+        *xrdm = NULL;
+        LOG(ERROR, "Could not get reserved device memory maps.\n");
+    }
+    return rc;
+}
+
+/*
+ * Check whether there exists rdm hole in the specified memory range.
+ * Returns true if exists, else returns false.
+ */
+static bool overlaps_rdm(uint64_t start, uint64_t memsize,
+                         uint64_t rdm_start, uint64_t rdm_size)
+{
+    return (start + memsize > rdm_start) && (start < rdm_start + rdm_size);
+}
+
+static void
+add_rdm_entry(libxl__gc *gc, libxl_domain_config *d_config,
+              uint64_t rdm_start, uint64_t rdm_size, int rdm_policy)
+{
+    d_config->rdms = libxl__realloc(NOGC, d_config->rdms,
+                    (d_config->num_rdms+1) * sizeof(libxl_device_rdm));
+
+    d_config->rdms[d_config->num_rdms].start = rdm_start;
+    d_config->rdms[d_config->num_rdms].size = rdm_size;
+    d_config->rdms[d_config->num_rdms].policy = rdm_policy;
+    d_config->num_rdms++;
+}
+
+/*
+ * Check reported RDM regions and handle potential gfn conflicts according
+ * to user preferred policy.
+ *
+ * RDM can reside in address space beyond 4G theoretically, but we never
+ * see this in real world. So in order to avoid breaking highmem layout
+ * we don't solve highmem conflict. Note this means highmem rmrr could
+ * still be supported if no conflict.
+ *
+ * But in the case of lowmem, RDM probably scatter the whole RAM space.
+ * Especially multiple RDM entries would worsen this to lead a complicated
+ * memory layout. And then its hard to extend hvm_info_table{} to work
+ * hvmloader out. So here we're trying to figure out a simple solution to
+ * avoid breaking existing layout. So when a conflict occurs,
+ *
+ * #1. Above a predefined boundary (default 2G)
+ * - Move lowmem_end below reserved region to solve conflict;
+ *
+ * #2. Below a predefined boundary (default 2G)
+ * - Check strict/relaxed policy.
+ * "strict" policy leads to fail libxl.
+ * "relaxed" policy issue a warning message and also mask this entry
+ * INVALID to indicate we shouldn't expose this entry to hvmloader.
+ * Note when both policies are specified on a given region, the per-device
+ * policy should override the global policy.
+ */
+int libxl__domain_device_construct_rdm(libxl__gc *gc,
+                                       libxl_domain_config *d_config,
+                                       uint64_t rdm_mem_boundary,
+                                       struct xc_hvm_build_args *args)
+{
+    int i, j, conflict, rc;
+    struct xen_reserved_device_memory *xrdm = NULL;
+    uint32_t strategy = d_config->b_info.u.hvm.rdm.strategy;
+    uint16_t seg;
+    uint8_t bus, devfn;
+    uint64_t rdm_start, rdm_size;
+    uint64_t highmem_end = args->highmem_end ? args->highmem_end : (1ull<<32);
+
+    /*
+     * We just want to construct RDM once since RDM is specific to the
+     * given platform, so this shouldn't change again.
+     */
+    if (d_config->num_rdms)
+        return 0;
+
+    /* Might not expose rdm. */
+    if (strategy == LIBXL_RDM_RESERVE_STRATEGY_IGNORE &&
+        !d_config->num_pcidevs)
+        return 0;
+
+    /* Query all RDM entries in this platform */
+    if (strategy == LIBXL_RDM_RESERVE_STRATEGY_HOST) {
+        unsigned int nr_entries;
+
+        /* Collect all rdm info if exist. */
+        rc = libxl__xc_device_get_rdm(gc, XENMEM_RDM_ALL,
+                                      0, 0, 0, &nr_entries, &xrdm);
+        if (rc)
+            goto out;
+        if (!nr_entries)
+            return 0;
+
+        assert(xrdm);
+
+        for (i = 0; i < nr_entries; i++)
+        {
+            add_rdm_entry(gc, d_config,
+                          pfn_to_paddr(xrdm[i].start_pfn),
+                          pfn_to_paddr(xrdm[i].nr_pages),
+                          d_config->b_info.u.hvm.rdm.policy);
+        }
+    }
+
+    /* Query RDM entries per-device */
+    for (i = 0; i < d_config->num_pcidevs; i++) {
+        unsigned int nr_entries;
+        bool new = true;
+
+        seg = d_config->pcidevs[i].domain;
+        bus = d_config->pcidevs[i].bus;
+        devfn = PCI_DEVFN(d_config->pcidevs[i].dev,
+                          d_config->pcidevs[i].func);
+        nr_entries = 0;
+        rc = libxl__xc_device_get_rdm(gc, 0,
+                                      seg, bus, devfn, &nr_entries, &xrdm);
+        if (rc)
+            goto out;
+        /* No RDM to associated with this device. */
+        if (!nr_entries)
+            continue;
+
+        assert(xrdm);
+
+        /*
+         * Need to check whether this entry is already saved in the array.
+         * This could come from two cases:
+         *
+         *   - user may configure to get all RDMs in this platform, which
+         *   is already queried before this point
+         *   - or two assigned devices may share one RDM entry
+         *
+         * Different policies may be configured on the same RDM due to
+         * above two cases. But we don't allow to assign such a group
+         * devies right now so it doesn't come true in our case.
+         */
+        for (j = 0; j < d_config->num_rdms; j++) {
+            if (d_config->rdms[j].start == pfn_to_paddr(xrdm[0].start_pfn))
+            {
+                /*
+                 * So the per-device policy always override the global
+                 * policy in this case.
+                 */
+                d_config->rdms[j].policy = d_config->pcidevs[i].rdm_policy;
+                new = false;
+                break;
+            }
+        }
+
+        if (new) {
+            add_rdm_entry(gc, d_config,
+                          pfn_to_paddr(xrdm[0].start_pfn),
+                          pfn_to_paddr(xrdm[0].nr_pages),
+                          d_config->pcidevs[i].rdm_policy);
+        }
+    }
+
+    /*
+     * Next step is to check and avoid potential conflict between RDM
+     * entries and guest RAM. To avoid intrusive impact to existing
+     * memory layout {lowmem, mmio, highmem} which is passed around
+     * various function blocks, below conflicts are not handled which
+     * are rare and handling them would lead to a more scattered
+     * layout:
+     *  - RDM  in highmem area (>4G)
+     *  - RDM lower than a defined memory boundary (e.g. 2G)
+     * Otherwise for conflicts between boundary and 4G, we'll simply
+     * move lowmem end below reserved region to solve conflict.
+     *
+     * If a conflict is detected on a given RDM entry, an error will
+     * be returned if 'strict' policy is specified. Instead, if
+     * 'relaxed' policy specified, this conflict is treated just as a
+     * warning, but we mark this RDM entry as INVALID to indicate that
+     * this entry shouldn't be exposed to hvmloader.
+     *
+     * Firstly we should check the case of rdm < 4G because we may
+     * need to expand highmem_end.
+     */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        rdm_start = d_config->rdms[i].start;
+        rdm_size = d_config->rdms[i].size;
+        conflict = overlaps_rdm(0, args->lowmem_end, rdm_start, rdm_size);
+
+        if (!conflict)
+            continue;
+
+        /* Just check if RDM > our memory boundary. */
+        if (rdm_start > rdm_mem_boundary) {
+            /*
+             * We will move downwards lowmem_end so we have to expand
+             * highmem_end.
+             */
+            highmem_end += (args->lowmem_end - rdm_start);
+            /* Now move downwards lowmem_end. */
+            args->lowmem_end = rdm_start;
+        }
+    }
+
+    /* Sync highmem_end. */
+    args->highmem_end = highmem_end;
+
+    /*
+     * Finally we can take same policy to check lowmem(< 2G) and
+     * highmem adjusted above.
+     */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        rdm_start = d_config->rdms[i].start;
+        rdm_size = d_config->rdms[i].size;
+        /* Does this entry conflict with lowmem? */
+        conflict = overlaps_rdm(0, args->lowmem_end,
+                                rdm_start, rdm_size);
+        /* Does this entry conflict with highmem? */
+        conflict |= overlaps_rdm((1ULL<<32),
+                                 args->highmem_end - (1ULL<<32),
+                                 rdm_start, rdm_size);
+
+        if (!conflict)
+            continue;
+
+        if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
+            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            goto out;
+        } else {
+            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+                      d_config->rdms[i].start);
+
+            /*
+             * Then mask this INVALID to indicate we shouldn't expose this
+             * to hvmloader.
+             */
+            d_config->rdms[i].policy = LIBXL_RDM_RESERVE_POLICY_INVALID;
+        }
+    }
+
+    return 0;
+
+ out:
+    return ERROR_FAIL;
+}
+
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index edd7f3f..9af3b21 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -922,13 +922,20 @@ out:
 }
 
 int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info,
+              libxl_domain_config *d_config,
               libxl__domain_build_state *state)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     struct xc_hvm_build_args args = {};
     int ret, rc = ERROR_FAIL;
     uint64_t mmio_start, lowmem_end, highmem_end;
+    libxl_domain_build_info *const info = &d_config->b_info;
+    /*
+     * Currently we fix this as 2G to guarantee how to handle
+     * our rdm policy. But we'll provide a parameter to set
+     * this dynamically.
+     */
+    uint64_t rdm_mem_boundary = 0x80000000;
 
     memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
@@ -966,6 +973,14 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.highmem_end = highmem_end;
     args.mmio_start = mmio_start;
 
+    rc = libxl__domain_device_construct_rdm(gc, d_config,
+                                            rdm_mem_boundary,
+                                            &args);
+    if (rc) {
+        LOG(ERROR, "checking reserved device memory failed");
+        goto out;
+    }
+
     if (info->num_vnuma_nodes != 0) {
         int i;
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 4bb0f38..f2466dc 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -144,6 +144,9 @@
 #endif
   /* all of these macros preserve errno (saving and restoring) */
 
+/* Convert pfn to physical address space. */
+#define pfn_to_paddr(x) ((uint64_t)(x) << XC_PAGE_SHIFT)
+
 /* logging */
 _hidden void libxl__logv(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
              const char *file /* may be 0 */, int line /* ignored if !file */,
@@ -1079,7 +1082,7 @@ _hidden int libxl__build_post(libxl__gc *gc, uint32_t domid,
 _hidden int libxl__build_pv(libxl__gc *gc, uint32_t domid,
              libxl_domain_build_info *info, libxl__domain_build_state *state);
 _hidden int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info,
+              libxl_domain_config *d_config,
               libxl__domain_build_state *state);
 
 _hidden int libxl__qemu_traditional_cmd(libxl__gc *gc, uint32_t domid,
@@ -1587,6 +1590,15 @@ _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_channels, libxl_device_channel *channels);
 
 /*
+ * This function will fix reserved device memory conflict
+ * according to user's configuration.
+ */
+_hidden int libxl__domain_device_construct_rdm(libxl__gc *gc,
+                                   libxl_domain_config *d_config,
+                                   uint64_t rdm_mem_guard,
+                                   struct xc_hvm_build_args *args);
+
+/*
  * This function will cause the whole libxl process to hang
  * if the device model does not respond.  It is deprecated.
  *
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index db9f75a..157fa59 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -586,6 +586,12 @@ libxl_device_pci = Struct("device_pci", [
     ("rdm_policy",      libxl_rdm_reserve_policy),
     ])
 
+libxl_device_rdm = Struct("device_rdm", [
+    ("start", uint64),
+    ("size", uint64),
+    ("policy", libxl_rdm_reserve_policy),
+    ])
+
 libxl_device_dtdev = Struct("device_dtdev", [
     ("path", string),
     ])
@@ -616,6 +622,7 @@ libxl_domain_config = Struct("domain_config", [
     ("disks", Array(libxl_device_disk, "num_disks")),
     ("nics", Array(libxl_device_nic, "num_nics")),
     ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("rdms", Array(libxl_device_rdm, "num_rdms")),
     ("dtdevs", Array(libxl_device_dtdev, "num_dtdevs")),
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVU-0005wJ-Io; Fri, 31 Jul 2015 13:37: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 1ZLAVS-0005w3-SC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:51 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	7D/B4-05979-E2A7BB55; Fri, 31 Jul 2015 13:37:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349868!26711098!1
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 10088 invoked from network); 31 Jul 2015 13:37:49 -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;
	31 Jul 2015 13:37:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVQ-0004Sn-5C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVQ-0006uh-3p
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:48 +0000
Date: Fri, 31 Jul 2015 13:37:48 +0000
Message-Id: <E1ZLAVQ-0006uh-3p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: introduce a new parameter to
	set a predefined rdm boundary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc945aa39247df4db334ef92b2aa1b2fcdb6d0ad
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:10 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    tools: introduce a new parameter to set a predefined rdm boundary
    
    Previously we always fix that predefined boundary as 2G to handle
    conflict between memory and rdm, but now this predefined boundar
    can be changes with the parameter "rdm_mem_boundary" in .cfg file.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       |   22 ++++++++++++++++++++++
 tools/libxl/libxl.h         |    6 ++++++
 tools/libxl/libxl_create.c  |    4 ++++
 tools/libxl/libxl_dom.c     |    8 +-------
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    3 +++
 6 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e6e0f70..ce7ce85 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -845,6 +845,28 @@ More information about Xen gfx_passthru feature is available
 on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
 wiki page.
 
+=item B<rdm_mem_boundary=MBYTES>
+
+Number of megabytes to set a boundary for checking rdm conflict.
+
+When RDM conflicts with RAM, RDM probably scatter the whole RAM space.
+Especially multiple RDM entries would worsen this to lead a complicated
+memory layout. So here we're trying to figure out a simple solution to
+avoid breaking existing layout. So when a conflict occurs,
+
+    #1. Above a predefined boundary
+        - move lowmem_end below reserved region to solve conflict;
+
+    #2. Below a predefined boundary
+        - Check strict/relaxed policy.
+        "strict" policy leads to fail libxl. Note when both policies
+        are specified on a given region, 'strict' is always preferred.
+        "relaxed" policy issue a warning message and also mask this
+        entry INVALID to indicate we shouldn't expose this entry to
+        hvmloader.
+
+Here the default is 2G.
+
 =item B<dtdev=[ "DTDEV_PATH", "DTDEV_PATH", ... ]>
 
 Specifies the host device tree nodes to passthrough to this guest. Each
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5a7308d..927b2d8 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -909,6 +909,12 @@ const char *libxl_defbool_to_string(libxl_defbool b);
 #define LIBXL_TIMER_MODE_DEFAULT -1
 #define LIBXL_MEMKB_DEFAULT ~0ULL
 
+/*
+ * We'd like to set a memory boundary to determine if we need to check
+ * any overlap with reserved device memory.
+ */
+#define LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT (2048 * 1024)
+
 #define LIBXL_MS_VM_GENID_LEN 16
 typedef struct {
     uint8_t bytes[LIBXL_MS_VM_GENID_LEN];
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5b57062..b27c53a 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -54,6 +54,10 @@ void libxl__rdm_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info)
 {
     if (b_info->u.hvm.rdm.policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
         b_info->u.hvm.rdm.policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+
+    if (b_info->u.hvm.rdm_mem_boundary_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->u.hvm.rdm_mem_boundary_memkb =
+                            LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT;
 }
 
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 9af3b21..0b7c39d 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -930,12 +930,6 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     int ret, rc = ERROR_FAIL;
     uint64_t mmio_start, lowmem_end, highmem_end;
     libxl_domain_build_info *const info = &d_config->b_info;
-    /*
-     * Currently we fix this as 2G to guarantee how to handle
-     * our rdm policy. But we'll provide a parameter to set
-     * this dynamically.
-     */
-    uint64_t rdm_mem_boundary = 0x80000000;
 
     memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
@@ -974,7 +968,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.mmio_start = mmio_start;
 
     rc = libxl__domain_device_construct_rdm(gc, d_config,
-                                            rdm_mem_boundary,
+                                            info->u.hvm.rdm_mem_boundary_memkb*1024,
                                             &args);
     if (rc) {
         LOG(ERROR, "checking reserved device memory failed");
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 157fa59..9caaf44 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -503,6 +503,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("ms_vm_genid",      libxl_ms_vm_genid),
                                        ("serial_list",      libxl_string_list),
                                        ("rdm", libxl_rdm_reserve),
+                                       ("rdm_mem_boundary_memkb", MemKB),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 1d45dd5..c567a6a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1583,6 +1583,9 @@ static void parse_config_data(const char *config_source,
                     exit(1);
             }
         }
+
+        if (!xlu_cfg_get_long (config, "rdm_mem_boundary", &l, 0))
+            b_info->u.hvm.rdm_mem_boundary_memkb = l * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:37:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:37: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 1ZLAVU-0005wJ-Io; Fri, 31 Jul 2015 13:37: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 1ZLAVS-0005w3-SC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:51 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	7D/B4-05979-E2A7BB55; Fri, 31 Jul 2015 13:37:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1438349868!26711098!1
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 10088 invoked from network); 31 Jul 2015 13:37:49 -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;
	31 Jul 2015 13:37:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVQ-0004Sn-5C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVQ-0006uh-3p
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:48 +0000
Date: Fri, 31 Jul 2015 13:37:48 +0000
Message-Id: <E1ZLAVQ-0006uh-3p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: introduce a new parameter to
	set a predefined rdm boundary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc945aa39247df4db334ef92b2aa1b2fcdb6d0ad
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:10 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    tools: introduce a new parameter to set a predefined rdm boundary
    
    Previously we always fix that predefined boundary as 2G to handle
    conflict between memory and rdm, but now this predefined boundar
    can be changes with the parameter "rdm_mem_boundary" in .cfg file.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       |   22 ++++++++++++++++++++++
 tools/libxl/libxl.h         |    6 ++++++
 tools/libxl/libxl_create.c  |    4 ++++
 tools/libxl/libxl_dom.c     |    8 +-------
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    3 +++
 6 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e6e0f70..ce7ce85 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -845,6 +845,28 @@ More information about Xen gfx_passthru feature is available
 on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
 wiki page.
 
+=item B<rdm_mem_boundary=MBYTES>
+
+Number of megabytes to set a boundary for checking rdm conflict.
+
+When RDM conflicts with RAM, RDM probably scatter the whole RAM space.
+Especially multiple RDM entries would worsen this to lead a complicated
+memory layout. So here we're trying to figure out a simple solution to
+avoid breaking existing layout. So when a conflict occurs,
+
+    #1. Above a predefined boundary
+        - move lowmem_end below reserved region to solve conflict;
+
+    #2. Below a predefined boundary
+        - Check strict/relaxed policy.
+        "strict" policy leads to fail libxl. Note when both policies
+        are specified on a given region, 'strict' is always preferred.
+        "relaxed" policy issue a warning message and also mask this
+        entry INVALID to indicate we shouldn't expose this entry to
+        hvmloader.
+
+Here the default is 2G.
+
 =item B<dtdev=[ "DTDEV_PATH", "DTDEV_PATH", ... ]>
 
 Specifies the host device tree nodes to passthrough to this guest. Each
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5a7308d..927b2d8 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -909,6 +909,12 @@ const char *libxl_defbool_to_string(libxl_defbool b);
 #define LIBXL_TIMER_MODE_DEFAULT -1
 #define LIBXL_MEMKB_DEFAULT ~0ULL
 
+/*
+ * We'd like to set a memory boundary to determine if we need to check
+ * any overlap with reserved device memory.
+ */
+#define LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT (2048 * 1024)
+
 #define LIBXL_MS_VM_GENID_LEN 16
 typedef struct {
     uint8_t bytes[LIBXL_MS_VM_GENID_LEN];
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5b57062..b27c53a 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -54,6 +54,10 @@ void libxl__rdm_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info)
 {
     if (b_info->u.hvm.rdm.policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
         b_info->u.hvm.rdm.policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+
+    if (b_info->u.hvm.rdm_mem_boundary_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->u.hvm.rdm_mem_boundary_memkb =
+                            LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT;
 }
 
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 9af3b21..0b7c39d 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -930,12 +930,6 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     int ret, rc = ERROR_FAIL;
     uint64_t mmio_start, lowmem_end, highmem_end;
     libxl_domain_build_info *const info = &d_config->b_info;
-    /*
-     * Currently we fix this as 2G to guarantee how to handle
-     * our rdm policy. But we'll provide a parameter to set
-     * this dynamically.
-     */
-    uint64_t rdm_mem_boundary = 0x80000000;
 
     memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
@@ -974,7 +968,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.mmio_start = mmio_start;
 
     rc = libxl__domain_device_construct_rdm(gc, d_config,
-                                            rdm_mem_boundary,
+                                            info->u.hvm.rdm_mem_boundary_memkb*1024,
                                             &args);
     if (rc) {
         LOG(ERROR, "checking reserved device memory failed");
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 157fa59..9caaf44 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -503,6 +503,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("ms_vm_genid",      libxl_ms_vm_genid),
                                        ("serial_list",      libxl_string_list),
                                        ("rdm", libxl_rdm_reserve),
+                                       ("rdm_mem_boundary_memkb", MemKB),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 1d45dd5..c567a6a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1583,6 +1583,9 @@ static void parse_config_data(const char *config_source,
                     exit(1);
             }
         }
+
+        if (!xlu_cfg_get_long (config, "rdm_mem_boundary", &l, 0))
+            b_info->u.hvm.rdm_mem_boundary_memkb = l * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVf-0005xv-Lb; Fri, 31 Jul 2015 13:38: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 1ZLAVc-0005xc-TT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:02 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	37/83-01753-83A7BB55; Fri, 31 Jul 2015 13:38:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349878!31104540!1
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 9142 invoked from network); 31 Jul 2015 13:37:59 -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;
	31 Jul 2015 13:37:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVa-0004Sz-Au
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVa-0006vM-9S
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:58 +0000
Date: Fri, 31 Jul 2015 13:37:58 +0000
Message-Id: <E1ZLAVa-0006vM-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: construct e820 map with RDM
	information 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 bcde2f78ccf87ba78529c3c0624b2e6574033184
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:26 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    libxl: construct e820 map with RDM information for HVM guest
    
    Here we'll construct a basic guest e820 table via
    XENMEM_set_memory_map. This table includes lowmem, highmem
    and RDMs if they exist, and hvmloader would need this info
    later.
    
    Note this guest e820 table would be same as before if the
    platform has no any RDM or we disable RDM (by default).
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_arch.h |    7 ++++
 tools/libxl/libxl_arm.c  |    8 ++++
 tools/libxl/libxl_dom.c  |    5 +++
 tools/libxl/libxl_x86.c  |   83 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
index 9a80d43..bd030b6 100644
--- a/tools/libxl/libxl_arch.h
+++ b/tools/libxl/libxl_arch.h
@@ -55,4 +55,11 @@ int libxl__arch_vnuma_build_vmemrange(libxl__gc *gc,
 _hidden
 int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq);
 
+/* arch specific to construct memory mapping function */
+_hidden
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args);
+
 #endif
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index d306905..42ab6d8 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -969,6 +969,14 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
     return xc_domain_bind_pt_spi_irq(CTX->xch, domid, irq, irq);
 }
 
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args)
+{
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0b7c39d..a76d4b3 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1012,6 +1012,11 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         goto out;
     }
 
+    if (libxl__arch_domain_construct_memmap(gc, d_config, domid, &args)) {
+        LOG(ERROR, "setting domain memory map failed");
+        goto out;
+    }
+
     ret = hvm_build_set_params(ctx->xch, domid, info, state->store_port,
                                &state->store_mfn, state->console_port,
                                &state->console_mfn, state->store_domid,
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 8cd15ca..b3cf3e2 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -445,6 +445,89 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 }
 
 /*
+ * Here we're just trying to set these kinds of e820 mappings:
+ *
+ * #1. Low memory region
+ *
+ * Low RAM starts at least from 1M to make sure all standard regions
+ * of the PC memory map, like BIOS, VGA memory-mapped I/O and vgabios,
+ * have enough space.
+ * Note: Those stuffs below 1M are still constructed with multiple
+ * e820 entries by hvmloader. At this point we don't change anything.
+ *
+ * #2. RDM region if it exists
+ *
+ * #3. High memory region if it exists
+ *
+ * Note: these regions are not overlapping since we already check
+ * to adjust them. Please refer to libxl__domain_device_construct_rdm().
+ */
+#define GUEST_LOW_MEM_START_DEFAULT 0x100000
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args)
+{
+    int rc = 0;
+    unsigned int nr = 0, i;
+    /* We always own at least one lowmem entry. */
+    unsigned int e820_entries = 1;
+    struct e820entry *e820 = NULL;
+    uint64_t highmem_size =
+                    args->highmem_end ? args->highmem_end - (1ull << 32) : 0;
+
+    /* Add all rdm entries. */
+    for (i = 0; i < d_config->num_rdms; i++)
+        if (d_config->rdms[i].policy != LIBXL_RDM_RESERVE_POLICY_INVALID)
+            e820_entries++;
+
+
+    /* If we should have a highmem range. */
+    if (highmem_size)
+        e820_entries++;
+
+    if (e820_entries >= E820MAX) {
+        LOG(ERROR, "Ooops! Too many entries in the memory map!\n");
+        rc = ERROR_INVAL;
+        goto out;
+    }
+
+    e820 = libxl__malloc(gc, sizeof(struct e820entry) * e820_entries);
+
+    /* Low memory */
+    e820[nr].addr = GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].size = args->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].type = E820_RAM;
+    nr++;
+
+    /* RDM mapping */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+            continue;
+
+        e820[nr].addr = d_config->rdms[i].start;
+        e820[nr].size = d_config->rdms[i].size;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+
+    /* High memory */
+    if (highmem_size) {
+        e820[nr].addr = ((uint64_t)1 << 32);
+        e820[nr].size = highmem_size;
+        e820[nr].type = E820_RAM;
+    }
+
+    if (xc_domain_set_memory_map(CTX->xch, domid, e820, e820_entries) != 0) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+out:
+    return rc;
+}
+
+/*
  * Local variables:
  * mode: C
  * c-basic-offset: 4
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:38:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVf-0005xv-Lb; Fri, 31 Jul 2015 13:38: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 1ZLAVc-0005xc-TT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:02 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	37/83-01753-83A7BB55; Fri, 31 Jul 2015 13:38:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349878!31104540!1
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 9142 invoked from network); 31 Jul 2015 13:37:59 -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;
	31 Jul 2015 13:37:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVa-0004Sz-Au
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVa-0006vM-9S
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:37:58 +0000
Date: Fri, 31 Jul 2015 13:37:58 +0000
Message-Id: <E1ZLAVa-0006vM-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: construct e820 map with RDM
	information 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 bcde2f78ccf87ba78529c3c0624b2e6574033184
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:40:26 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    libxl: construct e820 map with RDM information for HVM guest
    
    Here we'll construct a basic guest e820 table via
    XENMEM_set_memory_map. This table includes lowmem, highmem
    and RDMs if they exist, and hvmloader would need this info
    later.
    
    Note this guest e820 table would be same as before if the
    platform has no any RDM or we disable RDM (by default).
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Checked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_arch.h |    7 ++++
 tools/libxl/libxl_arm.c  |    8 ++++
 tools/libxl/libxl_dom.c  |    5 +++
 tools/libxl/libxl_x86.c  |   83 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
index 9a80d43..bd030b6 100644
--- a/tools/libxl/libxl_arch.h
+++ b/tools/libxl/libxl_arch.h
@@ -55,4 +55,11 @@ int libxl__arch_vnuma_build_vmemrange(libxl__gc *gc,
 _hidden
 int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq);
 
+/* arch specific to construct memory mapping function */
+_hidden
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args);
+
 #endif
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index d306905..42ab6d8 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -969,6 +969,14 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
     return xc_domain_bind_pt_spi_irq(CTX->xch, domid, irq, irq);
 }
 
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args)
+{
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0b7c39d..a76d4b3 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1012,6 +1012,11 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         goto out;
     }
 
+    if (libxl__arch_domain_construct_memmap(gc, d_config, domid, &args)) {
+        LOG(ERROR, "setting domain memory map failed");
+        goto out;
+    }
+
     ret = hvm_build_set_params(ctx->xch, domid, info, state->store_port,
                                &state->store_mfn, state->console_port,
                                &state->console_mfn, state->store_domid,
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 8cd15ca..b3cf3e2 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -445,6 +445,89 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 }
 
 /*
+ * Here we're just trying to set these kinds of e820 mappings:
+ *
+ * #1. Low memory region
+ *
+ * Low RAM starts at least from 1M to make sure all standard regions
+ * of the PC memory map, like BIOS, VGA memory-mapped I/O and vgabios,
+ * have enough space.
+ * Note: Those stuffs below 1M are still constructed with multiple
+ * e820 entries by hvmloader. At this point we don't change anything.
+ *
+ * #2. RDM region if it exists
+ *
+ * #3. High memory region if it exists
+ *
+ * Note: these regions are not overlapping since we already check
+ * to adjust them. Please refer to libxl__domain_device_construct_rdm().
+ */
+#define GUEST_LOW_MEM_START_DEFAULT 0x100000
+int libxl__arch_domain_construct_memmap(libxl__gc *gc,
+                                        libxl_domain_config *d_config,
+                                        uint32_t domid,
+                                        struct xc_hvm_build_args *args)
+{
+    int rc = 0;
+    unsigned int nr = 0, i;
+    /* We always own at least one lowmem entry. */
+    unsigned int e820_entries = 1;
+    struct e820entry *e820 = NULL;
+    uint64_t highmem_size =
+                    args->highmem_end ? args->highmem_end - (1ull << 32) : 0;
+
+    /* Add all rdm entries. */
+    for (i = 0; i < d_config->num_rdms; i++)
+        if (d_config->rdms[i].policy != LIBXL_RDM_RESERVE_POLICY_INVALID)
+            e820_entries++;
+
+
+    /* If we should have a highmem range. */
+    if (highmem_size)
+        e820_entries++;
+
+    if (e820_entries >= E820MAX) {
+        LOG(ERROR, "Ooops! Too many entries in the memory map!\n");
+        rc = ERROR_INVAL;
+        goto out;
+    }
+
+    e820 = libxl__malloc(gc, sizeof(struct e820entry) * e820_entries);
+
+    /* Low memory */
+    e820[nr].addr = GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].size = args->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].type = E820_RAM;
+    nr++;
+
+    /* RDM mapping */
+    for (i = 0; i < d_config->num_rdms; i++) {
+        if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_INVALID)
+            continue;
+
+        e820[nr].addr = d_config->rdms[i].start;
+        e820[nr].size = d_config->rdms[i].size;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+
+    /* High memory */
+    if (highmem_size) {
+        e820[nr].addr = ((uint64_t)1 << 32);
+        e820[nr].size = highmem_size;
+        e820[nr].type = E820_RAM;
+    }
+
+    if (xc_domain_set_memory_map(CTX->xch, domid, e820, e820_entries) != 0) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+out:
+    return rc;
+}
+
+/*
  * Local variables:
  * mode: C
  * c-basic-offset: 4
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:38:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVq-0005zJ-O7; Fri, 31 Jul 2015 13:38: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 1ZLAVp-0005z5-9G
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:13 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	A4/EF-15765-44A7BB55; Fri, 31 Jul 2015 13:38:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438349888!36929860!1
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 29608 invoked from network); 31 Jul 2015 13:38:09 -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;
	31 Jul 2015 13:38:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVk-0004Ta-Gf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVk-0006w1-Fb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:08 +0000
Date: Fri, 31 Jul 2015 13:38:08 +0000
Message-Id: <E1ZLAVk-0006w1-Fb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: enable USB device assignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50057149293c81d2a1b2e83fc5dfc4e1b88255ba
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    xen/vtd: enable USB device assignment
    
    USB RMRR may conflict with guest BIOS region. In such case, identity
    mapping setup is simply skipped in previous implementation. Now we
    can handle this scenario cleanly with new policy mechanism so previous
    hack code can be removed now.
    
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.h  |    1 -
 xen/drivers/passthrough/vtd/iommu.c |   11 ++---------
 xen/drivers/passthrough/vtd/utils.c |    7 -------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h
index af1feef..af205f5 100644
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -129,7 +129,6 @@ do {                                                \
 
 int vtd_hw_check(void);
 void disable_pmr(struct iommu *iommu);
-int is_usb_device(u16 seg, u8 bus, u8 devfn);
 int is_igd_drhd(struct acpi_drhd_unit *drhd);
 
 #endif /* _DMAR_H_ */
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a2f3a66..8a8d763 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2242,11 +2242,9 @@ static int reassign_device_ownership(
     /*
      * If the device belongs to the hardware domain, and it has RMRR, don't
      * remove it from the hardware domain, because BIOS may use RMRR at
-     * booting time. Also account for the special casing of USB below (in
-     * intel_iommu_assign_device()).
+     * booting time.
      */
-    if ( !is_hardware_domain(source) &&
-         !is_usb_device(pdev->seg, pdev->bus, pdev->devfn) )
+    if ( !is_hardware_domain(source) )
     {
         const struct acpi_rmrr_unit *rmrr;
         u16 bdf;
@@ -2299,13 +2297,8 @@ static int intel_iommu_assign_device(
     if ( ret )
         return ret;
 
-    /* FIXME: Because USB RMRR conflicts with guest bios region,
-     * ignore USB RMRR temporarily.
-     */
     seg = pdev->seg;
     bus = pdev->bus;
-    if ( is_usb_device(seg, bus, pdev->devfn) )
-        return 0;
 
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, i )
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index bd14c02..b8a077f 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -29,13 +29,6 @@
 #include "extern.h"
 #include <asm/io_apic.h>
 
-int is_usb_device(u16 seg, u8 bus, u8 devfn)
-{
-    u16 class = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                                PCI_CLASS_DEVICE);
-    return (class == 0xc03);
-}
-
 /* Disable vt-d protected memory registers. */
 void disable_pmr(struct iommu *iommu)
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVq-0005zJ-O7; Fri, 31 Jul 2015 13:38: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 1ZLAVp-0005z5-9G
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:13 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	A4/EF-15765-44A7BB55; Fri, 31 Jul 2015 13:38:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438349888!36929860!1
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 29608 invoked from network); 31 Jul 2015 13:38:09 -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;
	31 Jul 2015 13:38:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVk-0004Ta-Gf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVk-0006w1-Fb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:08 +0000
Date: Fri, 31 Jul 2015 13:38:08 +0000
Message-Id: <E1ZLAVk-0006w1-Fb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: enable USB device assignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50057149293c81d2a1b2e83fc5dfc4e1b88255ba
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    xen/vtd: enable USB device assignment
    
    USB RMRR may conflict with guest BIOS region. In such case, identity
    mapping setup is simply skipped in previous implementation. Now we
    can handle this scenario cleanly with new policy mechanism so previous
    hack code can be removed now.
    
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.h  |    1 -
 xen/drivers/passthrough/vtd/iommu.c |   11 ++---------
 xen/drivers/passthrough/vtd/utils.c |    7 -------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h
index af1feef..af205f5 100644
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -129,7 +129,6 @@ do {                                                \
 
 int vtd_hw_check(void);
 void disable_pmr(struct iommu *iommu);
-int is_usb_device(u16 seg, u8 bus, u8 devfn);
 int is_igd_drhd(struct acpi_drhd_unit *drhd);
 
 #endif /* _DMAR_H_ */
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a2f3a66..8a8d763 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2242,11 +2242,9 @@ static int reassign_device_ownership(
     /*
      * If the device belongs to the hardware domain, and it has RMRR, don't
      * remove it from the hardware domain, because BIOS may use RMRR at
-     * booting time. Also account for the special casing of USB below (in
-     * intel_iommu_assign_device()).
+     * booting time.
      */
-    if ( !is_hardware_domain(source) &&
-         !is_usb_device(pdev->seg, pdev->bus, pdev->devfn) )
+    if ( !is_hardware_domain(source) )
     {
         const struct acpi_rmrr_unit *rmrr;
         u16 bdf;
@@ -2299,13 +2297,8 @@ static int intel_iommu_assign_device(
     if ( ret )
         return ret;
 
-    /* FIXME: Because USB RMRR conflicts with guest bios region,
-     * ignore USB RMRR temporarily.
-     */
     seg = pdev->seg;
     bus = pdev->bus;
-    if ( is_usb_device(seg, bus, pdev->devfn) )
-        return 0;
 
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, i )
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index bd14c02..b8a077f 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -29,13 +29,6 @@
 #include "extern.h"
 #include <asm/io_apic.h>
 
-int is_usb_device(u16 seg, u8 bus, u8 devfn)
-{
-    u16 class = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                                PCI_CLASS_DEVICE);
-    return (class == 0xc03);
-}
-
 /* Disable vt-d protected memory registers. */
 void disable_pmr(struct iommu *iommu)
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVx-00060O-R2; Fri, 31 Jul 2015 13: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 1ZLAVx-00060F-5Y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:21 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	31/29-16965-C4A7BB55; Fri, 31 Jul 2015 13:38:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349898!30995052!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 23807 invoked from network); 31 Jul 2015 13:38:19 -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;
	31 Jul 2015 13:38:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVu-0004Ti-OP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVu-0006wZ-Kk
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:18 +0000
Date: Fri, 31 Jul 2015 13:38:18 +0000
Message-Id: <E1ZLAVu-0006wZ-Kk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: prevent from assign the
	device with shared rmrr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6457dae9960bf6f31cef928a6997b6b5b6386a6d
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    xen/vtd: prevent from assign the device with shared rmrr
    
    Currently we're intending to cover this kind of devices
    with shared RMRR simply since the case of shared RMRR is
    a rare case according to our previous experiences. But
    late we can group these devices which shared rmrr, and
    then allow all devices within a group to be assigned to
    same domain.
    
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 8a8d763..ce5c295 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2293,13 +2293,37 @@ static int intel_iommu_assign_device(
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
 
+    seg = pdev->seg;
+    bus = pdev->bus;
+    /*
+     * In rare cases one given rmrr is shared by multiple devices but
+     * obviously this would put the security of a system at risk. So
+     * we should prevent from this sort of device assignment.
+     *
+     * TODO: in the future we can introduce group device assignment
+     * interface to make sure devices sharing RMRR are assigned to the
+     * same domain together.
+     */
+    for_each_rmrr_device( rmrr, bdf, i )
+    {
+        if ( rmrr->segment == seg &&
+             PCI_BUS(bdf) == bus &&
+             PCI_DEVFN2(bdf) == devfn &&
+             rmrr->scope.devices_cnt > 1 )
+        {
+            printk(XENLOG_G_ERR VTDPREFIX
+                   " cannot assign %04x:%02x:%02x.%u"
+                   " with shared RMRR at %"PRIx64" for Dom%d.\n",
+                   seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                   rmrr->base_address, d->domain_id);
+            return -EPERM;
+        }
+    }
+
     ret = reassign_device_ownership(hardware_domain, d, devfn, pdev);
     if ( ret )
         return ret;
 
-    seg = pdev->seg;
-    bus = pdev->bus;
-
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, 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 Fri Jul 31 13:38:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAVx-00060O-R2; Fri, 31 Jul 2015 13: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 1ZLAVx-00060F-5Y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:21 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	31/29-16965-C4A7BB55; Fri, 31 Jul 2015 13:38:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438349898!30995052!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 23807 invoked from network); 31 Jul 2015 13:38:19 -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;
	31 Jul 2015 13:38:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVu-0004Ti-OP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAVu-0006wZ-Kk
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:18 +0000
Date: Fri, 31 Jul 2015 13:38:18 +0000
Message-Id: <E1ZLAVu-0006wZ-Kk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/vtd: prevent from assign the
	device with shared rmrr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6457dae9960bf6f31cef928a6997b6b5b6386a6d
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    xen/vtd: prevent from assign the device with shared rmrr
    
    Currently we're intending to cover this kind of devices
    with shared RMRR simply since the case of shared RMRR is
    a rare case according to our previous experiences. But
    late we can group these devices which shared rmrr, and
    then allow all devices within a group to be assigned to
    same domain.
    
    CC: Yang Zhang <yang.z.zhang@intel.com>
    CC: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 8a8d763..ce5c295 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2293,13 +2293,37 @@ static int intel_iommu_assign_device(
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
 
+    seg = pdev->seg;
+    bus = pdev->bus;
+    /*
+     * In rare cases one given rmrr is shared by multiple devices but
+     * obviously this would put the security of a system at risk. So
+     * we should prevent from this sort of device assignment.
+     *
+     * TODO: in the future we can introduce group device assignment
+     * interface to make sure devices sharing RMRR are assigned to the
+     * same domain together.
+     */
+    for_each_rmrr_device( rmrr, bdf, i )
+    {
+        if ( rmrr->segment == seg &&
+             PCI_BUS(bdf) == bus &&
+             PCI_DEVFN2(bdf) == devfn &&
+             rmrr->scope.devices_cnt > 1 )
+        {
+            printk(XENLOG_G_ERR VTDPREFIX
+                   " cannot assign %04x:%02x:%02x.%u"
+                   " with shared RMRR at %"PRIx64" for Dom%d.\n",
+                   seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                   rmrr->base_address, d->domain_id);
+            return -EPERM;
+        }
+    }
+
     ret = reassign_device_ownership(hardware_domain, d, devfn, pdev);
     if ( ret )
         return ret;
 
-    seg = pdev->seg;
-    bus = pdev->bus;
-
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, 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 Fri Jul 31 13:38:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAW8-000625-Tq; Fri, 31 Jul 2015 13:38: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 1ZLAW7-00061j-HS
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:31 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	64/B7-32615-65A7BB55; Fri, 31 Jul 2015 13:38:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438349909!19579561!1
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 3340 invoked from network); 31 Jul 2015 13:38:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:38:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAW4-0004Tq-V0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAW4-0006xt-Ti
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:28 +0000
Date: Fri, 31 Jul 2015 13:38:28 +0000
Message-Id: <E1ZLAW4-0006xt-Ti@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: parse to enable new rdm policy
	parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a619657e2d5725a61cb72f65901db42e98f2a896
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    tools: parse to enable new rdm policy parameters
    
    This patch parses to enable user configurable parameters to specify
    RDM resource and according policies which are defined previously,
    
    Global RDM parameter:
        rdm = "strategy=host,policy=strict/relaxed"
    Per-device RDM parameter:
        pci = [ 'sbdf, rdm_policy=strict/relaxed' ]
    
    Default per-device RDM policy is same as default global RDM policy as being
    'relaxed'. And the per-device policy would override the global policy like
    others.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxlu_pci.c |   92 +++++++++++++++++++++++++++++++++++++++++++++-
 tools/libxl/libxlutil.h  |    4 ++
 tools/libxl/xl_cmdimpl.c |   13 ++++++
 3 files changed, 108 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxlu_pci.c b/tools/libxl/libxlu_pci.c
index 26fb143..026413b 100644
--- a/tools/libxl/libxlu_pci.c
+++ b/tools/libxl/libxlu_pci.c
@@ -42,6 +42,9 @@ static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
 #define STATE_OPTIONS_K 6
 #define STATE_OPTIONS_V 7
 #define STATE_TERMINAL  8
+#define STATE_TYPE      9
+#define STATE_RDM_STRATEGY      10
+#define STATE_RESERVE_POLICY    11
 int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str)
 {
     unsigned state = STATE_DOMAIN;
@@ -143,7 +146,18 @@ int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str
                     pcidev->permissive = atoi(tok);
                 }else if ( !strcmp(optkey, "seize") ) {
                     pcidev->seize = atoi(tok);
-                }else{
+                } else if (!strcmp(optkey, "rdm_policy")) {
+                    if (!strcmp(tok, "strict")) {
+                        pcidev->rdm_policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
+                    } else if (!strcmp(tok, "relaxed")) {
+                        pcidev->rdm_policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+                    } else {
+                        XLU__PCI_ERR(cfg, "%s is not an valid PCI RDM property"
+                                          " policy: 'strict' or 'relaxed'.",
+                                     tok);
+                        goto parse_error;
+                    }
+                } else {
                     XLU__PCI_ERR(cfg, "Unknown PCI BDF option: %s", optkey);
                 }
                 tok = ptr + 1;
@@ -167,6 +181,82 @@ parse_error:
     return ERROR_INVAL;
 }
 
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)
+{
+    unsigned state = STATE_TYPE;
+    char *buf2, *tok, *ptr, *end;
+
+    if (NULL == (buf2 = ptr = strdup(str)))
+        return ERROR_NOMEM;
+
+    for (tok = ptr, end = ptr + strlen(ptr) + 1; ptr < end; ptr++) {
+        switch(state) {
+        case STATE_TYPE:
+            if (*ptr == '=') {
+                state = STATE_RDM_STRATEGY;
+                *ptr = '\0';
+                if (strcmp(tok, "strategy")) {
+                    XLU__PCI_ERR(cfg, "Unknown RDM state option: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_RDM_STRATEGY:
+            if (*ptr == '\0' || *ptr == ',') {
+                state = STATE_RESERVE_POLICY;
+                *ptr = '\0';
+                if (!strcmp(tok, "host")) {
+                    rdm->strategy = LIBXL_RDM_RESERVE_STRATEGY_HOST;
+                } else {
+                    XLU__PCI_ERR(cfg, "Unknown RDM strategy option: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_RESERVE_POLICY:
+            if (*ptr == '=') {
+                state = STATE_OPTIONS_V;
+                *ptr = '\0';
+                if (strcmp(tok, "policy")) {
+                    XLU__PCI_ERR(cfg, "Unknown RDM property value: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_OPTIONS_V:
+            if (*ptr == ',' || *ptr == '\0') {
+                state = STATE_TERMINAL;
+                *ptr = '\0';
+                if (!strcmp(tok, "strict")) {
+                    rdm->policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
+                } else if (!strcmp(tok, "relaxed")) {
+                    rdm->policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+                } else {
+                    XLU__PCI_ERR(cfg, "Unknown RDM property policy value: %s",
+                                 tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+        default:
+            break;
+        }
+    }
+
+    free(buf2);
+
+    if (tok != ptr || state != STATE_TERMINAL)
+        goto parse_error;
+
+    return 0;
+
+parse_error:
+    return ERROR_INVAL;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxlutil.h b/tools/libxl/libxlutil.h
index 989605a..e81b644 100644
--- a/tools/libxl/libxlutil.h
+++ b/tools/libxl/libxlutil.h
@@ -106,6 +106,10 @@ int xlu_disk_parse(XLU_Config *cfg, int nspecs, const char *const *specs,
  */
 int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str);
 
+/*
+ * RDM parsing
+ */
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str);
 
 /*
  * Vif rate parsing.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c567a6a..938d1d3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1982,6 +1982,14 @@ skip_vfb:
         xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
     }
 
+    if (!xlu_cfg_get_string(config, "rdm", &buf, 0)) {
+        libxl_rdm_reserve rdm;
+        if (!xlu_rdm_parse(config, &rdm, buf)) {
+            b_info->u.hvm.rdm.strategy = rdm.strategy;
+            b_info->u.hvm.rdm.policy = rdm.policy;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         d_config->num_pcidevs = 0;
         d_config->pcidevs = NULL;
@@ -1995,6 +2003,11 @@ skip_vfb:
             pcidev->power_mgmt = pci_power_mgmt;
             pcidev->permissive = pci_permissive;
             pcidev->seize = pci_seize;
+            /*
+             * Like other pci option, the per-device policy always follows
+             * the global policy by default.
+             */
+            pcidev->rdm_policy = b_info->u.hvm.rdm.policy;
             e = xlu_pci_parse_bdf(config, pcidev, buf);
             if (e) {
                 fprintf(stderr,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAW8-000625-Tq; Fri, 31 Jul 2015 13:38: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 1ZLAW7-00061j-HS
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:31 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	64/B7-32615-65A7BB55; Fri, 31 Jul 2015 13:38:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1438349909!19579561!1
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 3340 invoked from network); 31 Jul 2015 13:38:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:38:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAW4-0004Tq-V0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAW4-0006xt-Ti
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:28 +0000
Date: Fri, 31 Jul 2015 13:38:28 +0000
Message-Id: <E1ZLAW4-0006xt-Ti@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: parse to enable new rdm policy
	parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a619657e2d5725a61cb72f65901db42e98f2a896
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Wed Jul 22 01:39:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 13:45:26 2015 +0100

    tools: parse to enable new rdm policy parameters
    
    This patch parses to enable user configurable parameters to specify
    RDM resource and according policies which are defined previously,
    
    Global RDM parameter:
        rdm = "strategy=host,policy=strict/relaxed"
    Per-device RDM parameter:
        pci = [ 'sbdf, rdm_policy=strict/relaxed' ]
    
    Default per-device RDM policy is same as default global RDM policy as being
    'relaxed'. And the per-device policy would override the global policy like
    others.
    
    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>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxlu_pci.c |   92 +++++++++++++++++++++++++++++++++++++++++++++-
 tools/libxl/libxlutil.h  |    4 ++
 tools/libxl/xl_cmdimpl.c |   13 ++++++
 3 files changed, 108 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxlu_pci.c b/tools/libxl/libxlu_pci.c
index 26fb143..026413b 100644
--- a/tools/libxl/libxlu_pci.c
+++ b/tools/libxl/libxlu_pci.c
@@ -42,6 +42,9 @@ static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
 #define STATE_OPTIONS_K 6
 #define STATE_OPTIONS_V 7
 #define STATE_TERMINAL  8
+#define STATE_TYPE      9
+#define STATE_RDM_STRATEGY      10
+#define STATE_RESERVE_POLICY    11
 int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str)
 {
     unsigned state = STATE_DOMAIN;
@@ -143,7 +146,18 @@ int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str
                     pcidev->permissive = atoi(tok);
                 }else if ( !strcmp(optkey, "seize") ) {
                     pcidev->seize = atoi(tok);
-                }else{
+                } else if (!strcmp(optkey, "rdm_policy")) {
+                    if (!strcmp(tok, "strict")) {
+                        pcidev->rdm_policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
+                    } else if (!strcmp(tok, "relaxed")) {
+                        pcidev->rdm_policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+                    } else {
+                        XLU__PCI_ERR(cfg, "%s is not an valid PCI RDM property"
+                                          " policy: 'strict' or 'relaxed'.",
+                                     tok);
+                        goto parse_error;
+                    }
+                } else {
                     XLU__PCI_ERR(cfg, "Unknown PCI BDF option: %s", optkey);
                 }
                 tok = ptr + 1;
@@ -167,6 +181,82 @@ parse_error:
     return ERROR_INVAL;
 }
 
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)
+{
+    unsigned state = STATE_TYPE;
+    char *buf2, *tok, *ptr, *end;
+
+    if (NULL == (buf2 = ptr = strdup(str)))
+        return ERROR_NOMEM;
+
+    for (tok = ptr, end = ptr + strlen(ptr) + 1; ptr < end; ptr++) {
+        switch(state) {
+        case STATE_TYPE:
+            if (*ptr == '=') {
+                state = STATE_RDM_STRATEGY;
+                *ptr = '\0';
+                if (strcmp(tok, "strategy")) {
+                    XLU__PCI_ERR(cfg, "Unknown RDM state option: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_RDM_STRATEGY:
+            if (*ptr == '\0' || *ptr == ',') {
+                state = STATE_RESERVE_POLICY;
+                *ptr = '\0';
+                if (!strcmp(tok, "host")) {
+                    rdm->strategy = LIBXL_RDM_RESERVE_STRATEGY_HOST;
+                } else {
+                    XLU__PCI_ERR(cfg, "Unknown RDM strategy option: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_RESERVE_POLICY:
+            if (*ptr == '=') {
+                state = STATE_OPTIONS_V;
+                *ptr = '\0';
+                if (strcmp(tok, "policy")) {
+                    XLU__PCI_ERR(cfg, "Unknown RDM property value: %s", tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+            break;
+        case STATE_OPTIONS_V:
+            if (*ptr == ',' || *ptr == '\0') {
+                state = STATE_TERMINAL;
+                *ptr = '\0';
+                if (!strcmp(tok, "strict")) {
+                    rdm->policy = LIBXL_RDM_RESERVE_POLICY_STRICT;
+                } else if (!strcmp(tok, "relaxed")) {
+                    rdm->policy = LIBXL_RDM_RESERVE_POLICY_RELAXED;
+                } else {
+                    XLU__PCI_ERR(cfg, "Unknown RDM property policy value: %s",
+                                 tok);
+                    goto parse_error;
+                }
+                tok = ptr + 1;
+            }
+        default:
+            break;
+        }
+    }
+
+    free(buf2);
+
+    if (tok != ptr || state != STATE_TERMINAL)
+        goto parse_error;
+
+    return 0;
+
+parse_error:
+    return ERROR_INVAL;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxlutil.h b/tools/libxl/libxlutil.h
index 989605a..e81b644 100644
--- a/tools/libxl/libxlutil.h
+++ b/tools/libxl/libxlutil.h
@@ -106,6 +106,10 @@ int xlu_disk_parse(XLU_Config *cfg, int nspecs, const char *const *specs,
  */
 int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str);
 
+/*
+ * RDM parsing
+ */
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str);
 
 /*
  * Vif rate parsing.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c567a6a..938d1d3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1982,6 +1982,14 @@ skip_vfb:
         xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
     }
 
+    if (!xlu_cfg_get_string(config, "rdm", &buf, 0)) {
+        libxl_rdm_reserve rdm;
+        if (!xlu_rdm_parse(config, &rdm, buf)) {
+            b_info->u.hvm.rdm.strategy = rdm.strategy;
+            b_info->u.hvm.rdm.policy = rdm.policy;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         d_config->num_pcidevs = 0;
         d_config->pcidevs = NULL;
@@ -1995,6 +2003,11 @@ skip_vfb:
             pcidev->power_mgmt = pci_power_mgmt;
             pcidev->permissive = pci_permissive;
             pcidev->seize = pci_seize;
+            /*
+             * Like other pci option, the per-device policy always follows
+             * the global policy by default.
+             */
+            pcidev->rdm_policy = b_info->u.hvm.rdm.policy;
             e = xlu_pci_parse_bdf(config, pcidev, buf);
             if (e) {
                 fprintf(stderr,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAWL-00064U-35; Fri, 31 Jul 2015 13:38: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 1ZLAWK-00064M-AQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:44 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	FF/01-17885-36A7BB55; Fri, 31 Jul 2015 13:38:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1438349919!25004723!1
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 11117 invoked from network); 31 Jul 2015 13:38:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:38:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWF-0004U2-6M
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWF-0006yR-4D
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:39 +0000
Date: Fri, 31 Jul 2015 13:38:39 +0000
Message-Id: <E1ZLAWF-0006yR-4D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Expose
	xc_reserved_device_memory_map to ARM 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 b4a044f6e8b5da47790d44ba0b93fa12c1819642
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Jul 23 17:47:09 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 19:20:48 2015 +0100

    libxc: Expose xc_reserved_device_memory_map to ARM too
    
    The commit 25652f2 "tools/libxl: detect and avoid conflicts with RDM"
    introduced the usage of xc_reserved_device_memory_map in the libxl
    generic code. But the function is only defined for x86 which breaks the
    ARM build.
    
    The hypercall called by this helper is implemented in the generic code
    and doesn't contain any x86 specific code. Therefore, it's fine to
    expose the helper to ARM.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    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>
    CC: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h |    2 +-
 tools/libxc/xc_domain.c       |   70 ++++++++++++++++++++--------------------
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3f2381a..0a98aee 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1314,6 +1314,7 @@ int xc_domain_set_memory_map(xc_interface *xch,
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries);
+#endif
 
 int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint32_t flags,
@@ -1322,7 +1323,6 @@ int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint8_t devfn,
                                   struct xen_reserved_device_memory entries[],
                                   uint32_t *max_entries);
-#endif
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index df06314..77d852b 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -685,41 +685,6 @@ int xc_domain_set_memory_map(xc_interface *xch,
     return rc;
 }
 
-int xc_reserved_device_memory_map(xc_interface *xch,
-                                  uint32_t flags,
-                                  uint16_t seg,
-                                  uint8_t bus,
-                                  uint8_t devfn,
-                                  struct xen_reserved_device_memory entries[],
-                                  uint32_t *max_entries)
-{
-    int rc;
-    struct xen_reserved_device_memory_map xrdmmap = {
-        .flags = flags,
-        .dev.pci.seg = seg,
-        .dev.pci.bus = bus,
-        .dev.pci.devfn = devfn,
-        .nr_entries = *max_entries
-    };
-    DECLARE_HYPERCALL_BOUNCE(entries,
-                             sizeof(struct xen_reserved_device_memory) *
-                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-
-    if ( xc_hypercall_bounce_pre(xch, entries) )
-        return -1;
-
-    set_xen_guest_handle(xrdmmap.buffer, entries);
-
-    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
-                      &xrdmmap, sizeof(xrdmmap));
-
-    xc_hypercall_bounce_post(xch, entries);
-
-    *max_entries = xrdmmap.nr_entries;
-
-    return rc;
-}
-
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries)
@@ -766,6 +731,41 @@ int xc_domain_set_memmap_limit(xc_interface *xch,
 }
 #endif
 
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries)
+{
+    int rc;
+    struct xen_reserved_device_memory_map xrdmmap = {
+        .flags = flags,
+        .dev.pci.seg = seg,
+        .dev.pci.bus = bus,
+        .dev.pci.devfn = devfn,
+        .nr_entries = *max_entries
+    };
+    DECLARE_HYPERCALL_BOUNCE(entries,
+                             sizeof(struct xen_reserved_device_memory) *
+                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+    if ( xc_hypercall_bounce_pre(xch, entries) )
+        return -1;
+
+    set_xen_guest_handle(xrdmmap.buffer, entries);
+
+    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
+                      &xrdmmap, sizeof(xrdmmap));
+
+    xc_hypercall_bounce_post(xch, entries);
+
+    *max_entries = xrdmmap.nr_entries;
+
+    return rc;
+}
+
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds)
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAWL-00064U-35; Fri, 31 Jul 2015 13:38: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 1ZLAWK-00064M-AQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:44 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	FF/01-17885-36A7BB55; Fri, 31 Jul 2015 13:38:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1438349919!25004723!1
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 11117 invoked from network); 31 Jul 2015 13:38:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:38:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWF-0004U2-6M
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWF-0006yR-4D
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:39 +0000
Date: Fri, 31 Jul 2015 13:38:39 +0000
Message-Id: <E1ZLAWF-0006yR-4D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Expose
	xc_reserved_device_memory_map to ARM 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 b4a044f6e8b5da47790d44ba0b93fa12c1819642
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Jul 23 17:47:09 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jul 23 19:20:48 2015 +0100

    libxc: Expose xc_reserved_device_memory_map to ARM too
    
    The commit 25652f2 "tools/libxl: detect and avoid conflicts with RDM"
    introduced the usage of xc_reserved_device_memory_map in the libxl
    generic code. But the function is only defined for x86 which breaks the
    ARM build.
    
    The hypercall called by this helper is implemented in the generic code
    and doesn't contain any x86 specific code. Therefore, it's fine to
    expose the helper to ARM.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    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>
    CC: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h |    2 +-
 tools/libxc/xc_domain.c       |   70 ++++++++++++++++++++--------------------
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3f2381a..0a98aee 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1314,6 +1314,7 @@ int xc_domain_set_memory_map(xc_interface *xch,
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries);
+#endif
 
 int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint32_t flags,
@@ -1322,7 +1323,6 @@ int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint8_t devfn,
                                   struct xen_reserved_device_memory entries[],
                                   uint32_t *max_entries);
-#endif
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index df06314..77d852b 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -685,41 +685,6 @@ int xc_domain_set_memory_map(xc_interface *xch,
     return rc;
 }
 
-int xc_reserved_device_memory_map(xc_interface *xch,
-                                  uint32_t flags,
-                                  uint16_t seg,
-                                  uint8_t bus,
-                                  uint8_t devfn,
-                                  struct xen_reserved_device_memory entries[],
-                                  uint32_t *max_entries)
-{
-    int rc;
-    struct xen_reserved_device_memory_map xrdmmap = {
-        .flags = flags,
-        .dev.pci.seg = seg,
-        .dev.pci.bus = bus,
-        .dev.pci.devfn = devfn,
-        .nr_entries = *max_entries
-    };
-    DECLARE_HYPERCALL_BOUNCE(entries,
-                             sizeof(struct xen_reserved_device_memory) *
-                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-
-    if ( xc_hypercall_bounce_pre(xch, entries) )
-        return -1;
-
-    set_xen_guest_handle(xrdmmap.buffer, entries);
-
-    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
-                      &xrdmmap, sizeof(xrdmmap));
-
-    xc_hypercall_bounce_post(xch, entries);
-
-    *max_entries = xrdmmap.nr_entries;
-
-    return rc;
-}
-
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries)
@@ -766,6 +731,41 @@ int xc_domain_set_memmap_limit(xc_interface *xch,
 }
 #endif
 
+int xc_reserved_device_memory_map(xc_interface *xch,
+                                  uint32_t flags,
+                                  uint16_t seg,
+                                  uint8_t bus,
+                                  uint8_t devfn,
+                                  struct xen_reserved_device_memory entries[],
+                                  uint32_t *max_entries)
+{
+    int rc;
+    struct xen_reserved_device_memory_map xrdmmap = {
+        .flags = flags,
+        .dev.pci.seg = seg,
+        .dev.pci.bus = bus,
+        .dev.pci.devfn = devfn,
+        .nr_entries = *max_entries
+    };
+    DECLARE_HYPERCALL_BOUNCE(entries,
+                             sizeof(struct xen_reserved_device_memory) *
+                             *max_entries, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+    if ( xc_hypercall_bounce_pre(xch, entries) )
+        return -1;
+
+    set_xen_guest_handle(xrdmmap.buffer, entries);
+
+    rc = do_memory_op(xch, XENMEM_reserved_device_memory_map,
+                      &xrdmmap, sizeof(xrdmmap));
+
+    xc_hypercall_bounce_post(xch, entries);
+
+    *max_entries = xrdmmap.nr_entries;
+
+    return rc;
+}
+
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds)
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:38:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAWV-00065m-5b; Fri, 31 Jul 2015 13:38: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 1ZLAWU-00065W-0e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:54 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F3/2A-19220-D6A7BB55; Fri, 31 Jul 2015 13:38:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1438349929!24988076!1
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 8353 invoked from network); 31 Jul 2015 13:38: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;
	31 Jul 2015 13:38:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWP-0004UA-GH
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWP-0006zG-AQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:49 +0000
Date: Fri, 31 Jul 2015 13:38:49 +0000
Message-Id: <E1ZLAWP-0006zG-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: reorganize
	cpu_disable_scheduler()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4862065a2df3849456e3fdebb480ced038f1c2c1
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jul 24 11:26:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 11:26:34 2015 +0200

    sched: reorganize cpu_disable_scheduler()
    
    The function is called both when we want to remove a cpu
    from a cpupool, and during cpu teardown, for suspend or
    shutdown. If, however, the boot cpu (cpu 0, most of the
    times) is not present in the default cpupool, during
    suspend or shutdown, Xen crashes like this:
    
      root@Zhaman:~# xl cpupool-cpu-remove Pool-0 0
      root@Zhaman:~# shutdown -h now
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d0801238de>] _csched_cpu_pick+0x156/0x61f
      (XEN)    [<ffff82d080123db5>] csched_cpu_pick+0xe/0x10
      (XEN)    [<ffff82d08012de3c>] vcpu_migrate+0x18e/0x321
      (XEN)    [<ffff82d08012e4f8>] cpu_disable_scheduler+0x1cf/0x2ac
      (XEN)    [<ffff82d08018bb8d>] __cpu_disable+0x313/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d08013097a>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d0801325f0>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132926>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 15:
      (XEN) Assertion 'cpu < nr_cpu_ids' failed at ...URCES/xen/xen/xen.git/xen/include/xen/cpumask.h:97
      (XEN) ****************************************
    
    There also are problems when we try to suspend or shutdown
    with a cpupool configured with just one cpu (no matter, in
    this case, whether that is the boot cpu or not):
    
      root@Zhaman:~# xl create /etc/xen/test.cfg
      root@Zhaman:~# xl cpupool-migrate test Pool-1
      root@Zhaman:~# xl cpupool-list -c
      Name               CPU list
      Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,13,14,15
      Pool-1             12
      root@Zhaman:~# shutdown -h now
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      (XEN) CPU:    12
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d08018bb91>] __cpu_disable+0x317/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d08013097a>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d0801325f0>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132926>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 12:
      (XEN) Xen BUG at smpboot.c:895
      (XEN) ****************************************
    
    In both cases, the problem is the scheduler not being able
    to:
     - move all the vcpus to the boot cpu (as the boot cpu is
       not in the cpupool), in the former;
     - move the vcpus away from a cpu at all (as that is the
       only one cpu in the cpupool), in the latter.
    
    Solution is to distinguish, inside cpu_disable_scheduler(),
    the two cases of cpupool manipulation and teardown. For
    cpupool manipulation, it is correct to ask the scheduler to
    take an action, as pathological situation (like there not
    being any cpu in the pool where to send vcpus) are taken
    care of (i.e., forbidden!) already. For suspend and shutdown,
    we don't want the scheduler to be involved at all, as the
    final goal is pretty simple: "send all the vcpus to the
    boot cpu ASAP", so we just go for it.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/schedule.c |  104 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 88 insertions(+), 16 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index df8c1d0..df64268 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -454,9 +454,10 @@ void vcpu_unblock(struct vcpu *v)
  * Do the actual movement of a vcpu from old to new CPU. Locks for *both*
  * CPUs needs to have been taken already when calling this!
  */
-static void vcpu_move(struct vcpu *v, unsigned int old_cpu,
-                      unsigned int new_cpu)
+static void vcpu_move_locked(struct vcpu *v, unsigned int new_cpu)
 {
+    unsigned int old_cpu = v->processor;
+
     /*
      * Transfer urgency status to new CPU before switching CPUs, as
      * once the switch occurs, v->is_urgent is no longer protected by
@@ -478,6 +479,33 @@ static void vcpu_move(struct vcpu *v, unsigned int old_cpu,
         v->processor = new_cpu;
 }
 
+/*
+ * Move a vcpu from its current processor to a target new processor,
+ * without asking the scheduler to do any placement. This is intended
+ * for being called from special contexts, where things are quiet
+ * enough that no contention is supposed to happen (i.e., during
+ * shutdown or software suspend, like ACPI S3).
+ */
+static void vcpu_move_nosched(struct vcpu *v, unsigned int new_cpu)
+{
+    unsigned long flags;
+    spinlock_t *lock, *new_lock;
+
+    ASSERT(system_state == SYS_STATE_suspend);
+    ASSERT(!vcpu_runnable(v) && (atomic_read(&v->pause_count) ||
+                                 atomic_read(&v->domain->pause_count)));
+
+    lock = per_cpu(schedule_data, v->processor).schedule_lock;
+    new_lock = per_cpu(schedule_data, new_cpu).schedule_lock;
+
+    sched_spin_lock_double(lock, new_lock, &flags);
+    ASSERT(new_cpu != v->processor);
+    vcpu_move_locked(v, new_cpu);
+    sched_spin_unlock_double(lock, new_lock, flags);
+
+    sched_move_irqs(v);
+}
+
 static void vcpu_migrate(struct vcpu *v)
 {
     unsigned long flags;
@@ -542,7 +570,7 @@ static void vcpu_migrate(struct vcpu *v)
         return;
     }
 
-    vcpu_move(v, old_cpu, new_cpu);
+    vcpu_move_locked(v, new_cpu);
 
     sched_spin_unlock_double(old_lock, new_lock, flags);
 
@@ -615,7 +643,8 @@ int cpu_disable_scheduler(unsigned int cpu)
     struct vcpu *v;
     struct cpupool *c;
     cpumask_t online_affinity;
-    int    ret = 0;
+    unsigned int new_cpu;
+    int ret = 0;
 
     c = per_cpu(cpupool, cpu);
     if ( c == NULL )
@@ -644,25 +673,68 @@ int cpu_disable_scheduler(unsigned int cpu)
                 cpumask_setall(v->cpu_hard_affinity);
             }
 
-            if ( v->processor == cpu )
+            if ( v->processor != cpu )
             {
-                set_bit(_VPF_migrating, &v->pause_flags);
+                /* The vcpu is not on this cpu, so we can move on. */
                 vcpu_schedule_unlock_irqrestore(lock, flags, v);
-                vcpu_sleep_nosync(v);
-                vcpu_migrate(v);
+                continue;
+            }
+
+            /* If it is on this cpu, we must send it away. */
+            if ( unlikely(system_state == SYS_STATE_suspend) )
+            {
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
+
+                /*
+                 * If we are doing a shutdown/suspend, it is not necessary to
+                 * ask the scheduler to chime in. In fact:
+                 *  * there is no reason for it: the end result we are after
+                 *    is just 'all the vcpus on the boot pcpu, and no vcpu
+                 *    anywhere else', so let's just go for it;
+                 *  * it's wrong, for cpupools with only non-boot pcpus, as
+                 *    the scheduler would always fail to send the vcpus away
+                 *    from the last online (non boot) pcpu!
+                 *
+                 * Therefore, in the shutdown/suspend case, we just pick up
+                 * one (still) online pcpu. Note that, at this stage, all
+                 * domains (including dom0) have been paused already, so we
+                 * do not expect any vcpu activity at all.
+                 */
+                cpumask_andnot(&online_affinity, &cpu_online_map,
+                               cpumask_of(cpu));
+                BUG_ON(cpumask_empty(&online_affinity));
+                /*
+                 * As boot cpu is, usually, pcpu #0, using cpumask_first()
+                 * will make us converge quicker.
+                 */
+                new_cpu = cpumask_first(&online_affinity);
+                vcpu_move_nosched(v, new_cpu);
             }
             else
+            {
+                /*
+                 * OTOH, if the system is still live, and we are here because
+                 * we are doing some cpupool manipulations:
+                 *  * we want to call the scheduler, and let it re-evaluation
+                 *    the placement of the vcpu, taking into account the new
+                 *    cpupool configuration;
+                 *  * the scheduler will always fine a suitable solution, or
+                 *    things would have failed before getting in here.
+                 */
+                set_bit(_VPF_migrating, &v->pause_flags);
                 vcpu_schedule_unlock_irqrestore(lock, flags, v);
+                vcpu_sleep_nosync(v);
+                vcpu_migrate(v);
 
-            /*
-             * A vcpu active in the hypervisor will not be migratable.
-             * The caller should try again after releasing and reaquiring
-             * all locks.
-             */
-            if ( v->processor == cpu )
-                ret = -EAGAIN;
+                /*
+                 * The only caveat, in this case, is that if a vcpu active in
+                 * the hypervisor isn't migratable. In this case, the caller
+                 * should try again after releasing and reaquiring all locks.
+                 */
+                if ( v->processor == cpu )
+                    ret = -EAGAIN;
+            }
         }
-
         domain_update_node_affinity(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 Jul 31 13:38:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:38: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 1ZLAWV-00065m-5b; Fri, 31 Jul 2015 13:38: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 1ZLAWU-00065W-0e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:54 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F3/2A-19220-D6A7BB55; Fri, 31 Jul 2015 13:38:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1438349929!24988076!1
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 8353 invoked from network); 31 Jul 2015 13:38: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;
	31 Jul 2015 13:38:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWP-0004UA-GH
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWP-0006zG-AQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:49 +0000
Date: Fri, 31 Jul 2015 13:38:49 +0000
Message-Id: <E1ZLAWP-0006zG-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: reorganize
	cpu_disable_scheduler()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4862065a2df3849456e3fdebb480ced038f1c2c1
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jul 24 11:26:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 11:26:34 2015 +0200

    sched: reorganize cpu_disable_scheduler()
    
    The function is called both when we want to remove a cpu
    from a cpupool, and during cpu teardown, for suspend or
    shutdown. If, however, the boot cpu (cpu 0, most of the
    times) is not present in the default cpupool, during
    suspend or shutdown, Xen crashes like this:
    
      root@Zhaman:~# xl cpupool-cpu-remove Pool-0 0
      root@Zhaman:~# shutdown -h now
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d0801238de>] _csched_cpu_pick+0x156/0x61f
      (XEN)    [<ffff82d080123db5>] csched_cpu_pick+0xe/0x10
      (XEN)    [<ffff82d08012de3c>] vcpu_migrate+0x18e/0x321
      (XEN)    [<ffff82d08012e4f8>] cpu_disable_scheduler+0x1cf/0x2ac
      (XEN)    [<ffff82d08018bb8d>] __cpu_disable+0x313/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d08013097a>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d0801325f0>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132926>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 15:
      (XEN) Assertion 'cpu < nr_cpu_ids' failed at ...URCES/xen/xen/xen.git/xen/include/xen/cpumask.h:97
      (XEN) ****************************************
    
    There also are problems when we try to suspend or shutdown
    with a cpupool configured with just one cpu (no matter, in
    this case, whether that is the boot cpu or not):
    
      root@Zhaman:~# xl create /etc/xen/test.cfg
      root@Zhaman:~# xl cpupool-migrate test Pool-1
      root@Zhaman:~# xl cpupool-list -c
      Name               CPU list
      Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,13,14,15
      Pool-1             12
      root@Zhaman:~# shutdown -h now
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      (XEN) CPU:    12
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d08018bb91>] __cpu_disable+0x317/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d08013097a>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d0801325f0>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132926>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 12:
      (XEN) Xen BUG at smpboot.c:895
      (XEN) ****************************************
    
    In both cases, the problem is the scheduler not being able
    to:
     - move all the vcpus to the boot cpu (as the boot cpu is
       not in the cpupool), in the former;
     - move the vcpus away from a cpu at all (as that is the
       only one cpu in the cpupool), in the latter.
    
    Solution is to distinguish, inside cpu_disable_scheduler(),
    the two cases of cpupool manipulation and teardown. For
    cpupool manipulation, it is correct to ask the scheduler to
    take an action, as pathological situation (like there not
    being any cpu in the pool where to send vcpus) are taken
    care of (i.e., forbidden!) already. For suspend and shutdown,
    we don't want the scheduler to be involved at all, as the
    final goal is pretty simple: "send all the vcpus to the
    boot cpu ASAP", so we just go for it.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/schedule.c |  104 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 88 insertions(+), 16 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index df8c1d0..df64268 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -454,9 +454,10 @@ void vcpu_unblock(struct vcpu *v)
  * Do the actual movement of a vcpu from old to new CPU. Locks for *both*
  * CPUs needs to have been taken already when calling this!
  */
-static void vcpu_move(struct vcpu *v, unsigned int old_cpu,
-                      unsigned int new_cpu)
+static void vcpu_move_locked(struct vcpu *v, unsigned int new_cpu)
 {
+    unsigned int old_cpu = v->processor;
+
     /*
      * Transfer urgency status to new CPU before switching CPUs, as
      * once the switch occurs, v->is_urgent is no longer protected by
@@ -478,6 +479,33 @@ static void vcpu_move(struct vcpu *v, unsigned int old_cpu,
         v->processor = new_cpu;
 }
 
+/*
+ * Move a vcpu from its current processor to a target new processor,
+ * without asking the scheduler to do any placement. This is intended
+ * for being called from special contexts, where things are quiet
+ * enough that no contention is supposed to happen (i.e., during
+ * shutdown or software suspend, like ACPI S3).
+ */
+static void vcpu_move_nosched(struct vcpu *v, unsigned int new_cpu)
+{
+    unsigned long flags;
+    spinlock_t *lock, *new_lock;
+
+    ASSERT(system_state == SYS_STATE_suspend);
+    ASSERT(!vcpu_runnable(v) && (atomic_read(&v->pause_count) ||
+                                 atomic_read(&v->domain->pause_count)));
+
+    lock = per_cpu(schedule_data, v->processor).schedule_lock;
+    new_lock = per_cpu(schedule_data, new_cpu).schedule_lock;
+
+    sched_spin_lock_double(lock, new_lock, &flags);
+    ASSERT(new_cpu != v->processor);
+    vcpu_move_locked(v, new_cpu);
+    sched_spin_unlock_double(lock, new_lock, flags);
+
+    sched_move_irqs(v);
+}
+
 static void vcpu_migrate(struct vcpu *v)
 {
     unsigned long flags;
@@ -542,7 +570,7 @@ static void vcpu_migrate(struct vcpu *v)
         return;
     }
 
-    vcpu_move(v, old_cpu, new_cpu);
+    vcpu_move_locked(v, new_cpu);
 
     sched_spin_unlock_double(old_lock, new_lock, flags);
 
@@ -615,7 +643,8 @@ int cpu_disable_scheduler(unsigned int cpu)
     struct vcpu *v;
     struct cpupool *c;
     cpumask_t online_affinity;
-    int    ret = 0;
+    unsigned int new_cpu;
+    int ret = 0;
 
     c = per_cpu(cpupool, cpu);
     if ( c == NULL )
@@ -644,25 +673,68 @@ int cpu_disable_scheduler(unsigned int cpu)
                 cpumask_setall(v->cpu_hard_affinity);
             }
 
-            if ( v->processor == cpu )
+            if ( v->processor != cpu )
             {
-                set_bit(_VPF_migrating, &v->pause_flags);
+                /* The vcpu is not on this cpu, so we can move on. */
                 vcpu_schedule_unlock_irqrestore(lock, flags, v);
-                vcpu_sleep_nosync(v);
-                vcpu_migrate(v);
+                continue;
+            }
+
+            /* If it is on this cpu, we must send it away. */
+            if ( unlikely(system_state == SYS_STATE_suspend) )
+            {
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
+
+                /*
+                 * If we are doing a shutdown/suspend, it is not necessary to
+                 * ask the scheduler to chime in. In fact:
+                 *  * there is no reason for it: the end result we are after
+                 *    is just 'all the vcpus on the boot pcpu, and no vcpu
+                 *    anywhere else', so let's just go for it;
+                 *  * it's wrong, for cpupools with only non-boot pcpus, as
+                 *    the scheduler would always fail to send the vcpus away
+                 *    from the last online (non boot) pcpu!
+                 *
+                 * Therefore, in the shutdown/suspend case, we just pick up
+                 * one (still) online pcpu. Note that, at this stage, all
+                 * domains (including dom0) have been paused already, so we
+                 * do not expect any vcpu activity at all.
+                 */
+                cpumask_andnot(&online_affinity, &cpu_online_map,
+                               cpumask_of(cpu));
+                BUG_ON(cpumask_empty(&online_affinity));
+                /*
+                 * As boot cpu is, usually, pcpu #0, using cpumask_first()
+                 * will make us converge quicker.
+                 */
+                new_cpu = cpumask_first(&online_affinity);
+                vcpu_move_nosched(v, new_cpu);
             }
             else
+            {
+                /*
+                 * OTOH, if the system is still live, and we are here because
+                 * we are doing some cpupool manipulations:
+                 *  * we want to call the scheduler, and let it re-evaluation
+                 *    the placement of the vcpu, taking into account the new
+                 *    cpupool configuration;
+                 *  * the scheduler will always fine a suitable solution, or
+                 *    things would have failed before getting in here.
+                 */
+                set_bit(_VPF_migrating, &v->pause_flags);
                 vcpu_schedule_unlock_irqrestore(lock, flags, v);
+                vcpu_sleep_nosync(v);
+                vcpu_migrate(v);
 
-            /*
-             * A vcpu active in the hypervisor will not be migratable.
-             * The caller should try again after releasing and reaquiring
-             * all locks.
-             */
-            if ( v->processor == cpu )
-                ret = -EAGAIN;
+                /*
+                 * The only caveat, in this case, is that if a vcpu active in
+                 * the hypervisor isn't migratable. In this case, the caller
+                 * should try again after releasing and reaquiring all locks.
+                 */
+                if ( v->processor == cpu )
+                    ret = -EAGAIN;
+            }
         }
-
         domain_update_node_affinity(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 Jul 31 13:39:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAWd-00066z-87; Fri, 31 Jul 2015 13:39:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWc-00066n-7L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:02 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	A7/01-19110-57A7BB55; Fri, 31 Jul 2015 13:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1438349939!36892540!1
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 9458 invoked from network); 31 Jul 2015 13:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:39:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWZ-0004UI-M5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWZ-0006zu-Kq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:59 +0000
Date: Fri, 31 Jul 2015 13:38:59 +0000
Message-Id: <E1ZLAWZ-0006zu-Kq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched/cpupool: properly update
	affinity when removing a cpu from a cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2982a6f4e60dfbdd4747853f8bd5c7463705e14
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jul 24 11:29:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 11:29:35 2015 +0200

    sched/cpupool: properly update affinity when removing a cpu from a cpupool
    
    And this time, do it right. In fact, a similar change was
    attempted in 93be8285a79c6 ("cpupools: update domU's node-affinity
    on the cpupool_unassign_cpu() path"). But that was buggy, and got
    reverted with 8395b67ab0b8a86.
    
    However, even though reverting was the right thing to do, it
    remains true that:
     - calling the function is better done in the cpupool cpu removal
       code, even if just for simmetry with the cpupool cpu adding path;
     - it is not necessary to call it during cpu teardown (for suspend
       or shutdown) code as we either are going down and will never
       come up (shutdown) or, when coming up, we want everything to be
       as before the tearing down process started, and so we would just
       undo any update made during the process.
     - calling it from the teardown path is not only unnecessary, but
       it can trigger an ASSERT(), in case we get, during the process,
       to remove the last online pcpu of a domain's node affinity:
    
      (XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:466
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      ... ... ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d0801055b9>] domain_update_node_affinity+0x113/0x240
      (XEN)    [<ffff82d08012e676>] cpu_disable_scheduler+0x334/0x3f2
      (XEN)    [<ffff82d08018bb8d>] __cpu_disable+0x313/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d080130ad9>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d08013274f>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132a85>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 12:
      (XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:466
      (XEN) ****************************************
    
    Therefore, for all these reasons, move the call from
    cpu_disable_schedule() to cpupool_unassign_cpu_helper().
    
    While there, add some sanity checking (in the latter function), and
    make sure that scanning the domain list is done with domlist_read_lock
    held, at least when the system is 'live'.
    
    I re-tested the scenario described in here:
     http://permalink.gmane.org/gmane.comp.emulators.xen.devel/235310
    
    which is what led to the revert of 93be8285a79c6, and that is
    working ok after this commit.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/cpupool.c  |   18 ++++++++++++++++++
 xen/common/schedule.c |    7 ++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index b48ae17..69b984c 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -297,12 +297,25 @@ static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu)
 static long cpupool_unassign_cpu_helper(void *info)
 {
     int cpu = cpupool_moving_cpu;
+    struct cpupool *c = info;
+    struct domain *d;
     long ret;
 
     cpupool_dprintk("cpupool_unassign_cpu(pool=%d,cpu=%d)\n",
                     cpupool_cpu_moving->cpupool_id, cpu);
 
     spin_lock(&cpupool_lock);
+    if ( c != cpupool_cpu_moving )
+    {
+        ret = -EBUSY;
+        goto out;
+    }
+
+    /*
+     * We need this for scanning the domain list, both in
+     * cpu_disable_scheduler(), and at the bottom of this function.
+     */
+    rcu_read_lock(&domlist_read_lock);
     ret = cpu_disable_scheduler(cpu);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
     if ( !ret )
@@ -319,6 +332,11 @@ static long cpupool_unassign_cpu_helper(void *info)
         cpupool_cpu_moving = NULL;
     }
 
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
 out:
     spin_unlock(&cpupool_lock);
     cpupool_dprintk("cpupool_unassign_cpu ret=%ld\n", ret);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index df64268..3eefed7 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -650,6 +650,12 @@ int cpu_disable_scheduler(unsigned int cpu)
     if ( c == NULL )
         return ret;
 
+    /*
+     * We'd need the domain RCU lock, but:
+     *  - when we are called from cpupool code, it's acquired there already;
+     *  - when we are called for CPU teardown, we're in stop-machine context,
+     *    so that's not be a problem.
+     */
     for_each_domain_in_cpupool ( d, c )
     {
         for_each_vcpu ( d, v )
@@ -735,7 +741,6 @@ int cpu_disable_scheduler(unsigned int cpu)
                     ret = -EAGAIN;
             }
         }
-        domain_update_node_affinity(d);
     }
 
     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 Fri Jul 31 13:39:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAWd-00066z-87; Fri, 31 Jul 2015 13:39:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWc-00066n-7L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:02 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	A7/01-19110-57A7BB55; Fri, 31 Jul 2015 13:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1438349939!36892540!1
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 9458 invoked from network); 31 Jul 2015 13:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:39:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWZ-0004UI-M5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWZ-0006zu-Kq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:38:59 +0000
Date: Fri, 31 Jul 2015 13:38:59 +0000
Message-Id: <E1ZLAWZ-0006zu-Kq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched/cpupool: properly update
	affinity when removing a cpu from a cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2982a6f4e60dfbdd4747853f8bd5c7463705e14
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jul 24 11:29:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 11:29:35 2015 +0200

    sched/cpupool: properly update affinity when removing a cpu from a cpupool
    
    And this time, do it right. In fact, a similar change was
    attempted in 93be8285a79c6 ("cpupools: update domU's node-affinity
    on the cpupool_unassign_cpu() path"). But that was buggy, and got
    reverted with 8395b67ab0b8a86.
    
    However, even though reverting was the right thing to do, it
    remains true that:
     - calling the function is better done in the cpupool cpu removal
       code, even if just for simmetry with the cpupool cpu adding path;
     - it is not necessary to call it during cpu teardown (for suspend
       or shutdown) code as we either are going down and will never
       come up (shutdown) or, when coming up, we want everything to be
       as before the tearing down process started, and so we would just
       undo any update made during the process.
     - calling it from the teardown path is not only unnecessary, but
       it can trigger an ASSERT(), in case we get, during the process,
       to remove the last online pcpu of a domain's node affinity:
    
      (XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:466
      (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Tainted:    C ]----
      ... ... ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d0801055b9>] domain_update_node_affinity+0x113/0x240
      (XEN)    [<ffff82d08012e676>] cpu_disable_scheduler+0x334/0x3f2
      (XEN)    [<ffff82d08018bb8d>] __cpu_disable+0x313/0x36e
      (XEN)    [<ffff82d080101424>] take_cpu_down+0x34/0x3b
      (XEN)    [<ffff82d080130ad9>] stopmachine_action+0x70/0x99
      (XEN)    [<ffff82d08013274f>] do_tasklet_work+0x78/0xab
      (XEN)    [<ffff82d080132a85>] do_tasklet+0x5e/0x8a
      (XEN)    [<ffff82d08016478c>] idle_loop+0x56/0x6b
      (XEN)
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 12:
      (XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:466
      (XEN) ****************************************
    
    Therefore, for all these reasons, move the call from
    cpu_disable_schedule() to cpupool_unassign_cpu_helper().
    
    While there, add some sanity checking (in the latter function), and
    make sure that scanning the domain list is done with domlist_read_lock
    held, at least when the system is 'live'.
    
    I re-tested the scenario described in here:
     http://permalink.gmane.org/gmane.comp.emulators.xen.devel/235310
    
    which is what led to the revert of 93be8285a79c6, and that is
    working ok after this commit.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/cpupool.c  |   18 ++++++++++++++++++
 xen/common/schedule.c |    7 ++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index b48ae17..69b984c 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -297,12 +297,25 @@ static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu)
 static long cpupool_unassign_cpu_helper(void *info)
 {
     int cpu = cpupool_moving_cpu;
+    struct cpupool *c = info;
+    struct domain *d;
     long ret;
 
     cpupool_dprintk("cpupool_unassign_cpu(pool=%d,cpu=%d)\n",
                     cpupool_cpu_moving->cpupool_id, cpu);
 
     spin_lock(&cpupool_lock);
+    if ( c != cpupool_cpu_moving )
+    {
+        ret = -EBUSY;
+        goto out;
+    }
+
+    /*
+     * We need this for scanning the domain list, both in
+     * cpu_disable_scheduler(), and at the bottom of this function.
+     */
+    rcu_read_lock(&domlist_read_lock);
     ret = cpu_disable_scheduler(cpu);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
     if ( !ret )
@@ -319,6 +332,11 @@ static long cpupool_unassign_cpu_helper(void *info)
         cpupool_cpu_moving = NULL;
     }
 
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
 out:
     spin_unlock(&cpupool_lock);
     cpupool_dprintk("cpupool_unassign_cpu ret=%ld\n", ret);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index df64268..3eefed7 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -650,6 +650,12 @@ int cpu_disable_scheduler(unsigned int cpu)
     if ( c == NULL )
         return ret;
 
+    /*
+     * We'd need the domain RCU lock, but:
+     *  - when we are called from cpupool code, it's acquired there already;
+     *  - when we are called for CPU teardown, we're in stop-machine context,
+     *    so that's not be a problem.
+     */
     for_each_domain_in_cpupool ( d, c )
     {
         for_each_vcpu ( d, v )
@@ -735,7 +741,6 @@ int cpu_disable_scheduler(unsigned int cpu)
                     ret = -EAGAIN;
             }
         }
-        domain_update_node_affinity(d);
     }
 
     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 Fri Jul 31 13:39:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAWn-00068Q-Aj; Fri, 31 Jul 2015 13:39: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 1ZLAWm-00068I-2Z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:12 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	F7/B6-06021-F7A7BB55; Fri, 31 Jul 2015 13:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349950!31146734!1
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 21331 invoked from network); 31 Jul 2015 13:39: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;
	31 Jul 2015 13:39:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWj-0004Uw-Rn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWj-00070f-Q5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:09 +0000
Date: Fri, 31 Jul 2015 13:39:09 +0000
Message-Id: <E1ZLAWj-00070f-Q5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: link in the systemd system
	library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d70c9ce79d0201269b55ed6e906b25e83c7079b
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jul 23 08:40:39 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 10:49:33 2015 +0100

    oxenstored: link in the systemd system library
    
    If systemd is configured for use AND you are building oxenstored, the C
    systemd library must be linked in to the systemd.cxma library.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/xenstored/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index d861f11..59875f7 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -30,6 +30,8 @@ systemd_OBJS = systemd
 systemd_C_OBJS = systemd_stubs
 OCAML_LIBRARY += systemd
 
+LIBS_systemd += $(LDFLAGS-y)
+
 OBJS = define \
 	stdext \
 	trie \
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAWn-00068Q-Aj; Fri, 31 Jul 2015 13:39: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 1ZLAWm-00068I-2Z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:12 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	F7/B6-06021-F7A7BB55; Fri, 31 Jul 2015 13:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438349950!31146734!1
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 21331 invoked from network); 31 Jul 2015 13:39: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;
	31 Jul 2015 13:39:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWj-0004Uw-Rn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWj-00070f-Q5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:09 +0000
Date: Fri, 31 Jul 2015 13:39:09 +0000
Message-Id: <E1ZLAWj-00070f-Q5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: link in the systemd system
	library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d70c9ce79d0201269b55ed6e906b25e83c7079b
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jul 23 08:40:39 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 10:49:33 2015 +0100

    oxenstored: link in the systemd system library
    
    If systemd is configured for use AND you are building oxenstored, the C
    systemd library must be linked in to the systemd.cxma library.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/xenstored/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index d861f11..59875f7 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -30,6 +30,8 @@ systemd_OBJS = systemd
 systemd_C_OBJS = systemd_stubs
 OCAML_LIBRARY += systemd
 
+LIBS_systemd += $(LDFLAGS-y)
+
 OBJS = define \
 	stdext \
 	trie \
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAWx-0006A8-DA; Fri, 31 Jul 2015 13:39: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 1ZLAWw-00069q-A2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:22 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	2A/26-01753-98A7BB55; Fri, 31 Jul 2015 13:39:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1438349960!28696874!1
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 8730 invoked from network); 31 Jul 2015 13:39:21 -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;
	31 Jul 2015 13:39:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWu-0004V4-3E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWu-00071E-0E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:20 +0000
Date: Fri, 31 Jul 2015 13:39:20 +0000
Message-Id: <E1ZLAWu-00071E-0E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Document xenheap_megabytes
	limitation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7da1081d1ee403464ce1f4fbda5c084cfb868df
Author:     Chris (Christopher) Brand <chris.brand@broadcom.com>
AuthorDate: Thu Jul 23 16:31:56 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:16:11 2015 +0100

    xen: arm: Document xenheap_megabytes limitation
    
    In setup_mm(), the value passed as xenheap_megabytes gets
    converted to pages and passed to setup_xenheap_mappings(),
    which in turn passes it to create_32mb_mappings(), which
    contains an ASSERT that the value passed is a multiple of
    32MB. So specifying any value that is not an integer multiple
    of 32 will cause Xen to hit this assert and fail to boot.
    
    Signed-off-by: Chris Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xen-command-line.markdown |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 70d7ab8..a1bca2b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -242,7 +242,7 @@ the NMI watchdog is also enabled.
 
 > Default: `0` (1/32 of RAM)
 
-Amount of RAM to set aside for the Xenheap.
+Amount of RAM to set aside for the Xenheap. Must be an integer multiple of 32.
 
 By default will use 1/32 of the RAM up to a maximum of 1GB and with a
 minimum of 32M, subject to a suitably aligned and sized contiguous
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAWx-0006A8-DA; Fri, 31 Jul 2015 13:39: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 1ZLAWw-00069q-A2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:22 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	2A/26-01753-98A7BB55; Fri, 31 Jul 2015 13:39:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1438349960!28696874!1
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 8730 invoked from network); 31 Jul 2015 13:39:21 -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;
	31 Jul 2015 13:39:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWu-0004V4-3E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAWu-00071E-0E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:20 +0000
Date: Fri, 31 Jul 2015 13:39:20 +0000
Message-Id: <E1ZLAWu-00071E-0E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Document xenheap_megabytes
	limitation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7da1081d1ee403464ce1f4fbda5c084cfb868df
Author:     Chris (Christopher) Brand <chris.brand@broadcom.com>
AuthorDate: Thu Jul 23 16:31:56 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:16:11 2015 +0100

    xen: arm: Document xenheap_megabytes limitation
    
    In setup_mm(), the value passed as xenheap_megabytes gets
    converted to pages and passed to setup_xenheap_mappings(),
    which in turn passes it to create_32mb_mappings(), which
    contains an ASSERT that the value passed is a multiple of
    32MB. So specifying any value that is not an integer multiple
    of 32 will cause Xen to hit this assert and fail to boot.
    
    Signed-off-by: Chris Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xen-command-line.markdown |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 70d7ab8..a1bca2b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -242,7 +242,7 @@ the NMI watchdog is also enabled.
 
 > Default: `0` (1/32 of RAM)
 
-Amount of RAM to set aside for the Xenheap.
+Amount of RAM to set aside for the Xenheap. Must be an integer multiple of 32.
 
 By default will use 1/32 of the RAM up to a maximum of 1GB and with a
 minimum of 32M, subject to a suitably aligned and sized contiguous
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAXH-0006CQ-Hq; Fri, 31 Jul 2015 13:39: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 1ZLAXG-0006CF-NR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:42 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	F5/F7-06021-E9A7BB55; Fri, 31 Jul 2015 13:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349970!31105126!1
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 24232 invoked from network); 31 Jul 2015 13:39:36 -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;
	31 Jul 2015 13:39:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAX4-0004VC-8i
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAX4-00072W-7X
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:30 +0000
Date: Fri, 31 Jul 2015 13:39:30 +0000
Message-Id: <E1ZLAX4-00072W-7X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/tools: Widen the machine_irq in
	xc_domain_*bind_pt_irq_int
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a925e7151bded495a9603a93cdcea16cd3eb1c4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Jul 17 15:06:21 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:18:01 2015 +0100

    xen/tools: Widen the machine_irq in xc_domain_*bind_pt_irq_int
    
    The DOMCTLs {,un}bind_pt_irq are using uint32_t for the machine_irq
    while the helper is using uint8_t.
    
    Currently on ARM, we are supporting SPIs whose irq number can go up to
    1019 which doesn't fit in an uint8_t. The helpers xc_domain_bind_pt_spi
    and xc_domain_unbint_pt_spi are correctly taking an uint16_t so the
    libxc was truncating without noticing the user which may end up to
    route the wrong IRQ.
    
    Fix the problem by widening the machine_irq parameter in
    xc_domain_*bind_pt_irq_int.
    
    Note that XEN_DOMCTL_irq_permission has the same problem but it's not
    used at the moment on ARM. So we can defer the changes after the release
    of Xen 4.7.
    
    Reported-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 77d852b..582b0ae 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1923,7 +1923,7 @@ int xc_domain_unbind_msi_irq(
 static int xc_domain_bind_pt_irq_int(
     xc_interface *xch,
     uint32_t domid,
-    uint8_t machine_irq,
+    uint32_t machine_irq,
     uint8_t irq_type,
     uint8_t bus,
     uint8_t device,
@@ -1982,7 +1982,7 @@ int xc_domain_bind_pt_irq(
 static int xc_domain_unbind_pt_irq_int(
     xc_interface *xch,
     uint32_t domid,
-    uint8_t machine_irq,
+    uint32_t machine_irq,
     uint8_t irq_type,
     uint8_t bus,
     uint8_t device,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAXH-0006CQ-Hq; Fri, 31 Jul 2015 13:39: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 1ZLAXG-0006CF-NR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:42 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	F5/F7-06021-E9A7BB55; Fri, 31 Jul 2015 13:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438349970!31105126!1
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 24232 invoked from network); 31 Jul 2015 13:39:36 -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;
	31 Jul 2015 13:39:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAX4-0004VC-8i
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAX4-00072W-7X
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:30 +0000
Date: Fri, 31 Jul 2015 13:39:30 +0000
Message-Id: <E1ZLAX4-00072W-7X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/tools: Widen the machine_irq in
	xc_domain_*bind_pt_irq_int
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a925e7151bded495a9603a93cdcea16cd3eb1c4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Jul 17 15:06:21 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:18:01 2015 +0100

    xen/tools: Widen the machine_irq in xc_domain_*bind_pt_irq_int
    
    The DOMCTLs {,un}bind_pt_irq are using uint32_t for the machine_irq
    while the helper is using uint8_t.
    
    Currently on ARM, we are supporting SPIs whose irq number can go up to
    1019 which doesn't fit in an uint8_t. The helpers xc_domain_bind_pt_spi
    and xc_domain_unbint_pt_spi are correctly taking an uint16_t so the
    libxc was truncating without noticing the user which may end up to
    route the wrong IRQ.
    
    Fix the problem by widening the machine_irq parameter in
    xc_domain_*bind_pt_irq_int.
    
    Note that XEN_DOMCTL_irq_permission has the same problem but it's not
    used at the moment on ARM. So we can defer the changes after the release
    of Xen 4.7.
    
    Reported-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 77d852b..582b0ae 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1923,7 +1923,7 @@ int xc_domain_unbind_msi_irq(
 static int xc_domain_bind_pt_irq_int(
     xc_interface *xch,
     uint32_t domid,
-    uint8_t machine_irq,
+    uint32_t machine_irq,
     uint8_t irq_type,
     uint8_t bus,
     uint8_t device,
@@ -1982,7 +1982,7 @@ int xc_domain_bind_pt_irq(
 static int xc_domain_unbind_pt_irq_int(
     xc_interface *xch,
     uint32_t domid,
-    uint8_t machine_irq,
+    uint32_t machine_irq,
     uint8_t irq_type,
     uint8_t bus,
     uint8_t device,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:39:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAXI-0006Cs-KL; Fri, 31 Jul 2015 13: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 1ZLAXH-0006CG-5L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:43 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C3/9B-13905-E9A7BB55; Fri, 31 Jul 2015 13:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438349980!9259689!1
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 18299 invoked from network); 31 Jul 2015 13:39:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:39:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXE-0004VG-EY
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXE-000733-Ci
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:40 +0000
Date: Fri, 31 Jul 2015 13:39:40 +0000
Message-Id: <E1ZLAXE-000733-Ci@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Make
	COMMON_LONG_OPTS include sentinel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7985abb6dda04934894b2321fc657311595a66e1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:50 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:21:04 2015 +0100

    xl: Command line: Make COMMON_LONG_OPTS include sentinel
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- added comment to COMMON_LONG_OPTS ]
---
 tools/libxl/xl_cmdimpl.c |   52 ++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 33 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 938d1d3..4c53f29 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3068,7 +3068,9 @@ static int64_t parse_mem_size_kb(const char *mem)
     return kbytes;
 }
 
-#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
+/* Must be last in list */
+#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}, \
+                         {0, 0, 0, 0}
 
 /*
  * Callers should use SWITCH_FOREACH_OPT in preference to calling this
@@ -3081,8 +3083,7 @@ static int def_getopt(int argc, char * const argv[],
 {
     int opt;
     const struct option def_options[] = {
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     if (!longopts)
@@ -3348,8 +3349,7 @@ int main_vncviewer(int argc, char **argv)
     static const struct option opts[] = {
         {"autopass", 0, 0, 'a'},
         {"vncviewer-autopass", 0, 0, 'a'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     uint32_t domid;
     int opt, autopass = 0;
@@ -4482,8 +4482,7 @@ int main_restore(int argc, char **argv)
     static struct option opts[] = {
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "FcpdeVA", opts, "restore", 1) {
@@ -4615,8 +4614,7 @@ int main_migrate(int argc, char **argv)
     static struct option opts[] = {
         {"debug", 0, 0, 0x100},
         {"live", 0, 0, 0x200},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "FC:s:e", opts, "migrate", 2) {
@@ -4738,8 +4736,7 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
     static struct option opts[] = {
         {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "awF", opts, what, 0) {
@@ -4819,8 +4816,7 @@ int main_list(int argc, char **argv)
         {"context", 0, 0, 'Z'},
         {"cpupool", 0, 0, 'c'},
         {"numa", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     libxl_dominfo info_buf;
@@ -4926,8 +4922,7 @@ int main_create(int argc, char **argv)
         {"defconfig", 1, 0, 'f'},
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     dom_info.extra_config = NULL;
@@ -5020,8 +5015,7 @@ int main_config_update(int argc, char **argv)
     int debug = 0;
     static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     if (argc < 2) {
@@ -5627,8 +5621,7 @@ int main_info(int argc, char **argv)
     int opt;
     static struct option opts[] = {
         {"numa", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int numa = 0;
 
@@ -5966,8 +5959,7 @@ int main_sched_credit(int argc, char **argv)
         {"tslice_ms", 1, 0, 't'},
         {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:s", opts, "sched-credit", 0) {
@@ -6082,8 +6074,7 @@ int main_sched_credit2(int argc, char **argv)
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'p'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:w:p:", opts, "sched-credit2", 0) {
@@ -6155,8 +6146,7 @@ int main_sched_rtds(int argc, char **argv)
         {"period", 1, 0, 'p'},
         {"budget", 1, 0, 'b'},
         {"cpupool", 1, 0, 'c'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:p:b:c:", opts, "sched-rtds", 0) {
@@ -7224,8 +7214,7 @@ int main_cpupoolcreate(int argc, char **argv)
     static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
         {"dryrun", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int ret;
     char *config_data = 0;
@@ -7425,8 +7414,7 @@ int main_cpupoollist(int argc, char **argv)
     int opt;
     static struct option opts[] = {
         {"cpus", 0, 0, 'c'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int opt_cpus = 0;
     const char *pool = NULL;
@@ -8446,8 +8434,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
 
     static struct option opts[] = {
         {"socket", 1, 0, 's'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
@@ -8514,8 +8501,7 @@ int main_psr_hwinfo(int argc, char **argv)
     static struct option opts[] = {
         {"cmt", 0, 0, 'm'},
         {"cat", 0, 0, 'a'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "ma", opts, "psr-hwinfo", 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 Jul 31 13:39:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAXI-0006Cs-KL; Fri, 31 Jul 2015 13: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 1ZLAXH-0006CG-5L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:43 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C3/9B-13905-E9A7BB55; Fri, 31 Jul 2015 13:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438349980!9259689!1
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 18299 invoked from network); 31 Jul 2015 13:39:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:39:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXE-0004VG-EY
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXE-000733-Ci
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:40 +0000
Date: Fri, 31 Jul 2015 13:39:40 +0000
Message-Id: <E1ZLAXE-000733-Ci@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Make
	COMMON_LONG_OPTS include sentinel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7985abb6dda04934894b2321fc657311595a66e1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:50 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:21:04 2015 +0100

    xl: Command line: Make COMMON_LONG_OPTS include sentinel
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- added comment to COMMON_LONG_OPTS ]
---
 tools/libxl/xl_cmdimpl.c |   52 ++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 33 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 938d1d3..4c53f29 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3068,7 +3068,9 @@ static int64_t parse_mem_size_kb(const char *mem)
     return kbytes;
 }
 
-#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
+/* Must be last in list */
+#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}, \
+                         {0, 0, 0, 0}
 
 /*
  * Callers should use SWITCH_FOREACH_OPT in preference to calling this
@@ -3081,8 +3083,7 @@ static int def_getopt(int argc, char * const argv[],
 {
     int opt;
     const struct option def_options[] = {
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     if (!longopts)
@@ -3348,8 +3349,7 @@ int main_vncviewer(int argc, char **argv)
     static const struct option opts[] = {
         {"autopass", 0, 0, 'a'},
         {"vncviewer-autopass", 0, 0, 'a'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     uint32_t domid;
     int opt, autopass = 0;
@@ -4482,8 +4482,7 @@ int main_restore(int argc, char **argv)
     static struct option opts[] = {
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "FcpdeVA", opts, "restore", 1) {
@@ -4615,8 +4614,7 @@ int main_migrate(int argc, char **argv)
     static struct option opts[] = {
         {"debug", 0, 0, 0x100},
         {"live", 0, 0, 0x200},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "FC:s:e", opts, "migrate", 2) {
@@ -4738,8 +4736,7 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
     static struct option opts[] = {
         {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "awF", opts, what, 0) {
@@ -4819,8 +4816,7 @@ int main_list(int argc, char **argv)
         {"context", 0, 0, 'Z'},
         {"cpupool", 0, 0, 'c'},
         {"numa", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     libxl_dominfo info_buf;
@@ -4926,8 +4922,7 @@ int main_create(int argc, char **argv)
         {"defconfig", 1, 0, 'f'},
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     dom_info.extra_config = NULL;
@@ -5020,8 +5015,7 @@ int main_config_update(int argc, char **argv)
     int debug = 0;
     static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     if (argc < 2) {
@@ -5627,8 +5621,7 @@ int main_info(int argc, char **argv)
     int opt;
     static struct option opts[] = {
         {"numa", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int numa = 0;
 
@@ -5966,8 +5959,7 @@ int main_sched_credit(int argc, char **argv)
         {"tslice_ms", 1, 0, 't'},
         {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:s", opts, "sched-credit", 0) {
@@ -6082,8 +6074,7 @@ int main_sched_credit2(int argc, char **argv)
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'p'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:w:p:", opts, "sched-credit2", 0) {
@@ -6155,8 +6146,7 @@ int main_sched_rtds(int argc, char **argv)
         {"period", 1, 0, 'p'},
         {"budget", 1, 0, 'b'},
         {"cpupool", 1, 0, 'c'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "d:p:b:c:", opts, "sched-rtds", 0) {
@@ -7224,8 +7214,7 @@ int main_cpupoolcreate(int argc, char **argv)
     static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
         {"dryrun", 0, 0, 'n'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int ret;
     char *config_data = 0;
@@ -7425,8 +7414,7 @@ int main_cpupoollist(int argc, char **argv)
     int opt;
     static struct option opts[] = {
         {"cpus", 0, 0, 'c'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int opt_cpus = 0;
     const char *pool = NULL;
@@ -8446,8 +8434,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
 
     static struct option opts[] = {
         {"socket", 1, 0, 's'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
@@ -8514,8 +8501,7 @@ int main_psr_hwinfo(int argc, char **argv)
     static struct option opts[] = {
         {"cmt", 0, 0, 'm'},
         {"cat", 0, 0, 'a'},
-        COMMON_LONG_OPTS,
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
 
     SWITCH_FOREACH_OPT(opt, "ma", opts, "psr-hwinfo", 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 Jul 31 13:39:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAXS-0006EO-My; Fri, 31 Jul 2015 13:39: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 1ZLAXR-0006EG-GL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:53 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	A4/6D-04752-8AA7BB55; Fri, 31 Jul 2015 13:39:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1438349990!29323967!1
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 27670 invoked from network); 31 Jul 2015 13:39: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;
	31 Jul 2015 13:39:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXO-0004VS-Jz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXO-00073X-Iu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:50 +0000
Date: Fri, 31 Jul 2015 13:39:50 +0000
Message-Id: <E1ZLAXO-00073X-Iu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Support xl vcpu-set
	--help
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24ee2db6891ecf1747c7d0eefbba9b3db9ef7314
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:21:17 2015 +0100

    xl: Command line: Support xl vcpu-set --help
    
    This ended with a literal sentinel.  Use COMMON_LONG_OPTIONS (which
    mentions --help) instead.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4c53f29..ce8280f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5409,7 +5409,7 @@ int main_vcpuset(int argc, char **argv)
 {
     static struct option opts[] = {
         {"ignore-host", 0, 0, 'i'},
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int opt, check_host = 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 Jul 31 13:39:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:39: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 1ZLAXS-0006EO-My; Fri, 31 Jul 2015 13:39: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 1ZLAXR-0006EG-GL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:53 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	A4/6D-04752-8AA7BB55; Fri, 31 Jul 2015 13:39:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1438349990!29323967!1
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 27670 invoked from network); 31 Jul 2015 13:39: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;
	31 Jul 2015 13:39:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXO-0004VS-Jz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXO-00073X-Iu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:39:50 +0000
Date: Fri, 31 Jul 2015 13:39:50 +0000
Message-Id: <E1ZLAXO-00073X-Iu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Command line: Support xl vcpu-set
	--help
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24ee2db6891ecf1747c7d0eefbba9b3db9ef7314
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Jul 17 18:00:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:21:17 2015 +0100

    xl: Command line: Support xl vcpu-set --help
    
    This ended with a literal sentinel.  Use COMMON_LONG_OPTIONS (which
    mentions --help) instead.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4c53f29..ce8280f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5409,7 +5409,7 @@ int main_vcpuset(int argc, char **argv)
 {
     static struct option opts[] = {
         {"ignore-host", 0, 0, 'i'},
-        {0, 0, 0, 0}
+        COMMON_LONG_OPTS
     };
     int opt, check_host = 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 Jul 31 13:40:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXc-0006Fv-PU; Fri, 31 Jul 2015 13:40: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 1ZLAXb-0006Fh-5E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:03 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	3A/94-10678-2BA7BB55; Fri, 31 Jul 2015 13:40:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350000!31131186!1
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 447 invoked from network); 31 Jul 2015 13:40: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;
	31 Jul 2015 13:40:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXY-0004Va-Ot
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXY-00073v-NZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:00 +0000
Date: Fri, 31 Jul 2015 13:40:00 +0000
Message-Id: <E1ZLAXY-00073v-NZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: use thread-safe localtime_r and
	handle NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aba1db82f5f4ebe9d63dbb940abc8e25e5c29489
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:02 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:23:27 2015 +0100

    libxl: use thread-safe localtime_r and handle NULL
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_x86.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index b3cf3e2..b379e09 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -306,10 +306,16 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
     rtc_timeoffset = d_config->b_info.rtc_timeoffset;
     if (libxl_defbool_val(d_config->b_info.localtime)) {
         time_t t;
-        struct tm *tm;
+        struct tm *tm, result;
 
         t = time(NULL);
-        tm = localtime(&t);
+        tm = localtime_r(&t, &result);
+
+        if (!tm) {
+            LOGE(ERROR, "Failed to call localtime_r");
+            ret = ERROR_FAIL;
+            goto out;
+        }
 
         rtc_timeoffset += tm->tm_gmtoff;
     }
@@ -335,6 +341,7 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
         }
     }
 
+out:
     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 Fri Jul 31 13:40:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXc-0006Fv-PU; Fri, 31 Jul 2015 13:40: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 1ZLAXb-0006Fh-5E
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:03 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	3A/94-10678-2BA7BB55; Fri, 31 Jul 2015 13:40:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350000!31131186!1
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 447 invoked from network); 31 Jul 2015 13:40: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;
	31 Jul 2015 13:40:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXY-0004Va-Ot
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXY-00073v-NZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:00 +0000
Date: Fri, 31 Jul 2015 13:40:00 +0000
Message-Id: <E1ZLAXY-00073v-NZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: use thread-safe localtime_r and
	handle NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aba1db82f5f4ebe9d63dbb940abc8e25e5c29489
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:02 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:23:27 2015 +0100

    libxl: use thread-safe localtime_r and handle NULL
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_x86.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index b3cf3e2..b379e09 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -306,10 +306,16 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
     rtc_timeoffset = d_config->b_info.rtc_timeoffset;
     if (libxl_defbool_val(d_config->b_info.localtime)) {
         time_t t;
-        struct tm *tm;
+        struct tm *tm, result;
 
         t = time(NULL);
-        tm = localtime(&t);
+        tm = localtime_r(&t, &result);
+
+        if (!tm) {
+            LOGE(ERROR, "Failed to call localtime_r");
+            ret = ERROR_FAIL;
+            goto out;
+        }
 
         rtc_timeoffset += tm->tm_gmtoff;
     }
@@ -335,6 +341,7 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
         }
     }
 
+out:
     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 Fri Jul 31 13:40:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXp-0006HX-Se; Fri, 31 Jul 2015 13:40:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXo-0006HN-Pc
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:16 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	93/34-12946-FBA7BB55; Fri, 31 Jul 2015 13:40:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350011!31104893!1
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 3014 invoked from network); 31 Jul 2015 13:40:12 -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;
	31 Jul 2015 13:40:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXj-0004WB-2m
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXi-00075A-VX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:10 +0000
Date: Fri, 31 Jul 2015 13:40:10 +0000
Message-Id: <E1ZLAXi-00075A-VX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl/libxl: remove a bunch of pointless
	assignments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da66099b8b698bca3ca842d5ad67588444ab2537
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl/libxl: remove a bunch of pointless assignments
    
    Those values are  overwritten before they can be of any use.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dom.c             |    2 +-
 tools/libxl/libxl_remus_disk_drbd.c |    2 +-
 tools/libxl/xl_cmdimpl.c            |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index a76d4b3..3f2fec3 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1700,7 +1700,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
 {
     STATE_AO_GC(dss->ao);
     int port;
-    int rc = ERROR_FAIL;
+    int rc;
 
     /* Convenience aliases */
     const uint32_t domid = dss->domid;
diff --git a/tools/libxl/libxl_remus_disk_drbd.c b/tools/libxl/libxl_remus_disk_drbd.c
index fc76b89..1c3a88a 100644
--- a/tools/libxl/libxl_remus_disk_drbd.c
+++ b/tools/libxl/libxl_remus_disk_drbd.c
@@ -47,7 +47,7 @@ static void drbd_async_call(libxl__egc *egc,
                             void func(libxl__remus_device *),
                             libxl__ev_child_callback callback)
 {
-    int pid = -1, rc;
+    int pid, rc;
     libxl__ao_device *aodev = &dev->aodev;
     STATE_AO_GC(dev->rds->ao);
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ce8280f..a578e3b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4055,7 +4055,7 @@ static pid_t create_migration_child(const char *rune, int *send_fd,
                                         int *recv_fd)
 {
     int sendpipe[2], recvpipe[2];
-    pid_t child = -1;
+    pid_t child;
 
     if (!rune || !send_fd || !recv_fd)
         return -1;
@@ -7794,7 +7794,7 @@ int main_getenforce(int argc, char **argv)
 
 int main_setenforce(int argc, char **argv)
 {
-    int ret, mode = -1;
+    int ret, mode;
     const char *p = NULL;
 
     if (optind >= argc) {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:40:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXp-0006HX-Se; Fri, 31 Jul 2015 13:40:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXo-0006HN-Pc
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:16 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	93/34-12946-FBA7BB55; Fri, 31 Jul 2015 13:40:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350011!31104893!1
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 3014 invoked from network); 31 Jul 2015 13:40:12 -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;
	31 Jul 2015 13:40:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXj-0004WB-2m
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXi-00075A-VX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:10 +0000
Date: Fri, 31 Jul 2015 13:40:10 +0000
Message-Id: <E1ZLAXi-00075A-VX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl/libxl: remove a bunch of pointless
	assignments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da66099b8b698bca3ca842d5ad67588444ab2537
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl/libxl: remove a bunch of pointless assignments
    
    Those values are  overwritten before they can be of any use.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dom.c             |    2 +-
 tools/libxl/libxl_remus_disk_drbd.c |    2 +-
 tools/libxl/xl_cmdimpl.c            |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index a76d4b3..3f2fec3 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1700,7 +1700,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
 {
     STATE_AO_GC(dss->ao);
     int port;
-    int rc = ERROR_FAIL;
+    int rc;
 
     /* Convenience aliases */
     const uint32_t domid = dss->domid;
diff --git a/tools/libxl/libxl_remus_disk_drbd.c b/tools/libxl/libxl_remus_disk_drbd.c
index fc76b89..1c3a88a 100644
--- a/tools/libxl/libxl_remus_disk_drbd.c
+++ b/tools/libxl/libxl_remus_disk_drbd.c
@@ -47,7 +47,7 @@ static void drbd_async_call(libxl__egc *egc,
                             void func(libxl__remus_device *),
                             libxl__ev_child_callback callback)
 {
-    int pid = -1, rc;
+    int pid, rc;
     libxl__ao_device *aodev = &dev->aodev;
     STATE_AO_GC(dev->rds->ao);
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ce8280f..a578e3b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4055,7 +4055,7 @@ static pid_t create_migration_child(const char *rune, int *send_fd,
                                         int *recv_fd)
 {
     int sendpipe[2], recvpipe[2];
-    pid_t child = -1;
+    pid_t child;
 
     if (!rune || !send_fd || !recv_fd)
         return -1;
@@ -7794,7 +7794,7 @@ int main_getenforce(int argc, char **argv)
 
 int main_setenforce(int argc, char **argv)
 {
-    int ret, mode = -1;
+    int ret, mode;
     const char *p = NULL;
 
     if (optind >= argc) {
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:40:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXw-0006Ii-V2; Fri, 31 Jul 2015 13:40: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 1ZLAXv-0006IW-Qs
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	27/1E-04752-7CA7BB55; Fri, 31 Jul 2015 13:40:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350021!35428324!1
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 5415 invoked from network); 31 Jul 2015 13:40:22 -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;
	31 Jul 2015 13:40:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXt-0004WL-81
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXt-00075e-6c
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:21 +0000
Date: Fri, 31 Jul 2015 13:40:21 +0000
Message-Id: <E1ZLAXt-00075e-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: free pid string in do_daemonize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6aef0ff045fe46bac58d3fca8b10fa688fad6e47
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl: free pid string in do_daemonize
    
    Pid is a null terminated string allocated by asprintf. It should be
    freed after use.
    
    Also fixed a coding style problem while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@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 a578e3b..9027acb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -524,10 +524,12 @@ static int do_daemonize(char *name, const char *pidfile)
             exit(1);
         }
 
-        if ( close(fd) < 0 ) {
+        if (close(fd) < 0) {
             perror("Closing pidfile");
             exit(1);
         }
+
+        free(pid);
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:40:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAXw-0006Ii-V2; Fri, 31 Jul 2015 13:40: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 1ZLAXv-0006IW-Qs
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	27/1E-04752-7CA7BB55; Fri, 31 Jul 2015 13:40:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350021!35428324!1
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 5415 invoked from network); 31 Jul 2015 13:40:22 -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;
	31 Jul 2015 13:40:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXt-0004WL-81
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAXt-00075e-6c
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:21 +0000
Date: Fri, 31 Jul 2015 13:40:21 +0000
Message-Id: <E1ZLAXt-00075e-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: free pid string in do_daemonize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6aef0ff045fe46bac58d3fca8b10fa688fad6e47
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl: free pid string in do_daemonize
    
    Pid is a null terminated string allocated by asprintf. It should be
    freed after use.
    
    Also fixed a coding style problem while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@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 a578e3b..9027acb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -524,10 +524,12 @@ static int do_daemonize(char *name, const char *pidfile)
             exit(1);
         }
 
-        if ( close(fd) < 0 ) {
+        if (close(fd) < 0) {
             perror("Closing pidfile");
             exit(1);
         }
+
+        free(pid);
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:40:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAY7-0006Jr-1Q; Fri, 31 Jul 2015 13:40: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 1ZLAY5-0006Jc-M2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	F6/59-01753-1DA7BB55; Fri, 31 Jul 2015 13:40:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350031!31131370!1
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 5944 invoked from network); 31 Jul 2015 13:40:32 -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;
	31 Jul 2015 13:40:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAY3-0004WU-E6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAY3-000775-Bz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:31 +0000
Date: Fri, 31 Jul 2015 13:40:31 +0000
Message-Id: <E1ZLAY3-000775-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: check json string is not null
	before printing in create_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1e6d8923c5d16ac1d7a10fcd09eab50b0501de7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl: check json string is not null before printing in create_domain
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9027acb..a38074f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2781,6 +2781,11 @@ static uint32_t create_domain(struct domain_create *dom_info)
             printf_info_sexp(-1, &d_config, cfg_print_fh);
         } else {
             char *json = libxl_domain_config_to_json(ctx, &d_config);
+            if (!json) {
+                fprintf(stderr,
+                        "Failed to convert domain configuration to JSON\n");
+                exit(1);
+            }
             fputs(json, cfg_print_fh);
             free(json);
             flush_stream(cfg_print_fh);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:40:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAY7-0006Jr-1Q; Fri, 31 Jul 2015 13:40: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 1ZLAY5-0006Jc-M2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	F6/59-01753-1DA7BB55; Fri, 31 Jul 2015 13:40:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350031!31131370!1
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 5944 invoked from network); 31 Jul 2015 13:40:32 -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;
	31 Jul 2015 13:40:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAY3-0004WU-E6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAY3-000775-Bz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:31 +0000
Date: Fri, 31 Jul 2015 13:40:31 +0000
Message-Id: <E1ZLAY3-000775-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: check json string is not null
	before printing in create_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1e6d8923c5d16ac1d7a10fcd09eab50b0501de7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl: check json string is not null before printing in create_domain
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9027acb..a38074f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2781,6 +2781,11 @@ static uint32_t create_domain(struct domain_create *dom_info)
             printf_info_sexp(-1, &d_config, cfg_print_fh);
         } else {
             char *json = libxl_domain_config_to_json(ctx, &d_config);
+            if (!json) {
+                fprintf(stderr,
+                        "Failed to convert domain configuration to JSON\n");
+                exit(1);
+            }
             fputs(json, cfg_print_fh);
             free(json);
             flush_stream(cfg_print_fh);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:40:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAYI-0006LV-3s; Fri, 31 Jul 2015 13:40: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 1ZLAYG-0006LF-3J
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:44 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	C5/8A-06021-BDA7BB55; Fri, 31 Jul 2015 13:40:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350041!31105069!1
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 17940 invoked from network); 31 Jul 2015 13:40:42 -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;
	31 Jul 2015 13:40:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYD-0004Wc-Jf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYD-00077r-Ig
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:41 +0000
Date: Fri, 31 Jul 2015 13:40:41 +0000
Message-Id: <E1ZLAYD-00077r-Ig@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_{init,
	dispose} in psr_cmt_show
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9121a8c1b66c17195a89177b0915652afe8fb2dd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: call libxl_dominfo_{init, dispose} in psr_cmt_show
    
    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, 3 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a38074f..65a0f50 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8223,11 +8223,14 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
     /* Each domain */
     if (domid != INVALID_DOMID) {
         libxl_dominfo dominfo;
+
+        libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
             return -1;
         }
         psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        libxl_dominfo_dispose(&dominfo);
     }
     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 Jul 31 13:40:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAYI-0006LV-3s; Fri, 31 Jul 2015 13:40: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 1ZLAYG-0006LF-3J
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:44 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	C5/8A-06021-BDA7BB55; Fri, 31 Jul 2015 13:40:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350041!31105069!1
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 17940 invoked from network); 31 Jul 2015 13:40:42 -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;
	31 Jul 2015 13:40:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYD-0004Wc-Jf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYD-00077r-Ig
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:41 +0000
Date: Fri, 31 Jul 2015 13:40:41 +0000
Message-Id: <E1ZLAYD-00077r-Ig@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_{init,
	dispose} in psr_cmt_show
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9121a8c1b66c17195a89177b0915652afe8fb2dd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: call libxl_dominfo_{init, dispose} in psr_cmt_show
    
    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, 3 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a38074f..65a0f50 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8223,11 +8223,14 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
     /* Each domain */
     if (domid != INVALID_DOMID) {
         libxl_dominfo dominfo;
+
+        libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
             return -1;
         }
         psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        libxl_dominfo_dispose(&dominfo);
     }
     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 Jul 31 13:40:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAYS-0006NM-8G; Fri, 31 Jul 2015 13:40:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYQ-0006N8-C4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:54 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	E5/30-31069-5EA7BB55; Fri, 31 Jul 2015 13:40:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1438350052!31188075!1
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 18959 invoked from network); 31 Jul 2015 13:40:52 -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;
	31 Jul 2015 13:40:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYN-0004Wk-RY
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYN-00078b-Pe
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:51 +0000
Date: Fri, 31 Jul 2015 13:40:51 +0000
Message-Id: <E1ZLAYN-00078b-Pe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_bitmap_{init,
	dispose} in main_cpupoolcreate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0143490e6849bb89b0580441bea7ae4fb85a65d9
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:10 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: call libxl_bitmap_{init, dispose} in main_cpupoolcreate
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 65a0f50..e90521a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7249,6 +7249,9 @@ int main_cpupoolcreate(int argc, char **argv)
         break;
     }
 
+    libxl_bitmap_init(&freemap);
+    libxl_bitmap_init(&cpumap);
+
     while (optind < argc) {
         if ((p = strchr(argv[optind], '='))) {
             string_realloc_append(&extra_config, "\n");
@@ -7410,6 +7413,8 @@ int main_cpupoolcreate(int argc, char **argv)
 out_cfg:
     xlu_cfg_destroy(config);
 out:
+    libxl_bitmap_dispose(&freemap);
+    libxl_bitmap_dispose(&cpumap);
     free(name);
     free(config_data);
     free(extra_config);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:40:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:40: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 1ZLAYS-0006NM-8G; Fri, 31 Jul 2015 13:40:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYQ-0006N8-C4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:54 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	E5/30-31069-5EA7BB55; Fri, 31 Jul 2015 13:40:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1438350052!31188075!1
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 18959 invoked from network); 31 Jul 2015 13:40:52 -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;
	31 Jul 2015 13:40:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYN-0004Wk-RY
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYN-00078b-Pe
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:40:51 +0000
Date: Fri, 31 Jul 2015 13:40:51 +0000
Message-Id: <E1ZLAYN-00078b-Pe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_bitmap_{init,
	dispose} in main_cpupoolcreate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0143490e6849bb89b0580441bea7ae4fb85a65d9
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:10 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: call libxl_bitmap_{init, dispose} in main_cpupoolcreate
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 65a0f50..e90521a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7249,6 +7249,9 @@ int main_cpupoolcreate(int argc, char **argv)
         break;
     }
 
+    libxl_bitmap_init(&freemap);
+    libxl_bitmap_init(&cpumap);
+
     while (optind < argc) {
         if ((p = strchr(argv[optind], '='))) {
             string_realloc_append(&extra_config, "\n");
@@ -7410,6 +7413,8 @@ int main_cpupoolcreate(int argc, char **argv)
 out_cfg:
     xlu_cfg_destroy(config);
 out:
+    libxl_bitmap_dispose(&freemap);
+    libxl_bitmap_dispose(&cpumap);
     free(name);
     free(config_data);
     free(extra_config);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:41:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYc-0006Oc-Aq; Fri, 31 Jul 2015 13:41:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYa-0006OO-Cg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:04 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	9B/A0-24856-FEA7BB55; Fri, 31 Jul 2015 13:41:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438350062!24955853!1
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 30834 invoked from network); 31 Jul 2015 13:41:03 -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;
	31 Jul 2015 13:41:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYY-0004XL-3e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYY-00079r-0R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:02 +0000
Date: Fri, 31 Jul 2015 13:41:02 +0000
Message-Id: <E1ZLAYY-00079r-0R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: free event struct after use in
	main_shutdown_or_reboot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3fd3edf3c1c243a831385ae7b8e1ed68bd967461
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: free event struct after use in main_shutdown_or_reboot
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@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 e90521a..de1c9c0 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4781,8 +4781,10 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
                fallback_trigger);
         }
 
-        if (wait_for_it)
+        if (wait_for_it) {
             wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+            free(deathws);
+        }
 
         libxl_dominfo_list_free(dominfo, nb_domain);
     } 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 Jul 31 13:41:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYc-0006Oc-Aq; Fri, 31 Jul 2015 13:41:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYa-0006OO-Cg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:04 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	9B/A0-24856-FEA7BB55; Fri, 31 Jul 2015 13:41:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438350062!24955853!1
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 30834 invoked from network); 31 Jul 2015 13:41:03 -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;
	31 Jul 2015 13:41:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYY-0004XL-3e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYY-00079r-0R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:02 +0000
Date: Fri, 31 Jul 2015 13:41:02 +0000
Message-Id: <E1ZLAYY-00079r-0R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: free event struct after use in
	main_shutdown_or_reboot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3fd3edf3c1c243a831385ae7b8e1ed68bd967461
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jul 23 08:59:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:27:53 2015 +0100

    xl: free event struct after use in main_shutdown_or_reboot
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@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 e90521a..de1c9c0 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4781,8 +4781,10 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
                fallback_trigger);
         }
 
-        if (wait_for_it)
+        if (wait_for_it) {
             wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+            free(deathws);
+        }
 
         libxl_dominfo_list_free(dominfo, nb_domain);
     } 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 Jul 31 13:41:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYl-0006Pq-Fs; Fri, 31 Jul 2015 13:41: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 1ZLAYk-0006Pe-UP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:15 +0000
Content-Length: 2659
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	22/85-00536-AFA7BB55; Fri, 31 Jul 2015 13:41:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438350072!31096803!1
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 8775 invoked from network); 31 Jul 2015 13:41:13 -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;
	31 Jul 2015 13:41:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYi-0004XT-91
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYi-0007AE-7h
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:12 +0000
Date: Fri, 31 Jul 2015 13:41:12 +0000
Message-Id: <E1ZLAYi-0007AE-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: Use correct printf
	format for uint64_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6420098893303416536=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6420098893303416536==
Content-Length: 2255
Content-Transfer-Encoding: quoted-printable

commit 78222eb476e24833880a94e8cbd193e797abbe18
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 24 11:41:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:44:41 2015 +0100

    tools: libxl: Use correct printf format for uint64_t
    
    Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM"
    the build is broken for x86_32 and arm32 with:
    
    libxl_dm.c: In function =E2=80=98libxl__domain_device_construct_rdm=E2=80=99:
    libxl_dm.c:349:13: error: format =E2=80=98%lx=E2=80=99 expects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 8 has type =E2=80=98uint64_t=E2=80=99 [-Werror=3Dformat=3D]
                 LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
                 ^
    libxl_dm.c:352:13: error: format =E2=80=98%lx=E2=80=99 expects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 8 has type =E2=80=98uint64_t=E2=80=99 [-Werror=3Dformat=3D]
                 LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
    
    Use PRIx64 for these.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Tiejun Chen <tiejun.chen@intel.com>
---
 tools/libxl/libxl_dm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8d103c3..8ac007a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -346,10 +346,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
             continue;
 
         if (d_config->rdms[i].policy =3D=3D LIBXL_RDM_RESERVE_POLICY_STRICT) {
-            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            LOG(ERROR, "RDM conflict at 0x%"PRIx64".\n",
+                       d_config->rdms[i].start);
             goto out;
         } else {
-            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+            LOG(WARN, "Ignoring RDM conflict at 0x%"PRIx64".\n",
                       d_config->rdms[i].start);
 
             /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:41:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYl-0006Pq-Fs; Fri, 31 Jul 2015 13:41: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 1ZLAYk-0006Pe-UP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:15 +0000
Content-Length: 2659
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	22/85-00536-AFA7BB55; Fri, 31 Jul 2015 13:41:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438350072!31096803!1
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 8775 invoked from network); 31 Jul 2015 13:41:13 -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;
	31 Jul 2015 13:41:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYi-0004XT-91
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYi-0007AE-7h
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:12 +0000
Date: Fri, 31 Jul 2015 13:41:12 +0000
Message-Id: <E1ZLAYi-0007AE-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: Use correct printf
	format for uint64_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6420098893303416536=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6420098893303416536==
Content-Length: 2255
Content-Transfer-Encoding: quoted-printable

commit 78222eb476e24833880a94e8cbd193e797abbe18
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 24 11:41:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 11:44:41 2015 +0100

    tools: libxl: Use correct printf format for uint64_t
    
    Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM"
    the build is broken for x86_32 and arm32 with:
    
    libxl_dm.c: In function =E2=80=98libxl__domain_device_construct_rdm=E2=80=99:
    libxl_dm.c:349:13: error: format =E2=80=98%lx=E2=80=99 expects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 8 has type =E2=80=98uint64_t=E2=80=99 [-Werror=3Dformat=3D]
                 LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
                 ^
    libxl_dm.c:352:13: error: format =E2=80=98%lx=E2=80=99 expects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 8 has type =E2=80=98uint64_t=E2=80=99 [-Werror=3Dformat=3D]
                 LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
    
    Use PRIx64 for these.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Tiejun Chen <tiejun.chen@intel.com>
---
 tools/libxl/libxl_dm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8d103c3..8ac007a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -346,10 +346,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
             continue;
 
         if (d_config->rdms[i].policy =3D=3D LIBXL_RDM_RESERVE_POLICY_STRICT) {
-            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            LOG(ERROR, "RDM conflict at 0x%"PRIx64".\n",
+                       d_config->rdms[i].start);
             goto out;
         } else {
-            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+            LOG(WARN, "Ignoring RDM conflict at 0x%"PRIx64".\n",
                       d_config->rdms[i].start);
 
             /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:41:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYw-0006RU-Ia; Fri, 31 Jul 2015 13:41: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 1ZLAYv-0006RK-69
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:25 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	84/E5-29649-40B7BB55; Fri, 31 Jul 2015 13:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350082!31105315!1
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 1590 invoked from network); 31 Jul 2015 13:41:23 -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;
	31 Jul 2015 13:41:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYs-0004Xb-Dx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYs-0007Aa-CV
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:22 +0000
Date: Fri, 31 Jul 2015 13:41:22 +0000
Message-Id: <E1ZLAYs-0007Aa-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: Allow non-interactive 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 9072240954fc8a7c74ae04d2eb51c98bc0cb3356
Author:     Martin Lucina <martin@lucina.net>
AuthorDate: Fri Jul 24 13:30:48 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 12:41:24 2015 +0100

    xenconsole: Allow non-interactive use
    
    If xenconsole is run with stdin closed or redirected to /dev/null,
    console_loop() will return immediately due to failure to read from
    STDIN_FILENO. This patch tests if stdin and stdout are both connected to
    a TTY and, if not, xenconsole will not attempt to read from stdin or
    modify stdout terminal attributes.
    
    Existing behaviour when xenconsole is run from a terminal does not
    change.
    
    This allows for non-interactive use, eg. running "xl create -c" under
    systemd or piping the output of "xl console" to another command.
    
    Signed-off-by: Martin Lucina <martin@lucina.net>
    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/console/client/main.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f4c783b..753b3aa 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -168,16 +168,19 @@ static void restore_term(int fd, struct termios *old)
 	tcsetattr(fd, TCSANOW, old);
 }
 
-static int console_loop(int fd, struct xs_handle *xs, char *pty_path)
+static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
+		        bool interactive)
 {
-	int ret, xs_fd = xs_fileno(xs), max_fd;
+	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
 
 	do {
 		fd_set fds;
 
 		FD_ZERO(&fds);
-		FD_SET(STDIN_FILENO, &fds);
-		max_fd = STDIN_FILENO;
+		if (interactive) {
+			FD_SET(STDIN_FILENO, &fds);
+			max_fd = STDIN_FILENO;
+		}
 		FD_SET(xs_fd, &fds);
 		if (xs_fd > max_fd) max_fd = xs_fd;
 		if (fd != -1) FD_SET(fd, &fds);
@@ -284,6 +287,10 @@ int main(int argc, char **argv)
 	struct xs_handle *xs;
 	char *end;
 	console_type type = CONSOLE_INVAL;
+	bool interactive = 0;
+
+	if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
+		interactive = 1;
 
 	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
 		switch(ch) {
@@ -390,9 +397,11 @@ int main(int argc, char **argv)
 	}
 
 	init_term(spty, &attr);
-	init_term(STDIN_FILENO, &stdin_old_attr);
-	atexit(restore_term_stdin); /* if this fails, oh dear */
-	console_loop(spty, xs, path);
+	if (interactive) {
+		init_term(STDIN_FILENO, &stdin_old_attr);
+		atexit(restore_term_stdin); /* if this fails, oh dear */
+	}
+	console_loop(spty, xs, path, interactive);
 
 	free(path);
 	free(dom_path);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:41:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAYw-0006RU-Ia; Fri, 31 Jul 2015 13:41: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 1ZLAYv-0006RK-69
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:25 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	84/E5-29649-40B7BB55; Fri, 31 Jul 2015 13:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1438350082!31105315!1
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 1590 invoked from network); 31 Jul 2015 13:41:23 -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;
	31 Jul 2015 13:41:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYs-0004Xb-Dx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAYs-0007Aa-CV
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:22 +0000
Date: Fri, 31 Jul 2015 13:41:22 +0000
Message-Id: <E1ZLAYs-0007Aa-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: Allow non-interactive 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 9072240954fc8a7c74ae04d2eb51c98bc0cb3356
Author:     Martin Lucina <martin@lucina.net>
AuthorDate: Fri Jul 24 13:30:48 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 12:41:24 2015 +0100

    xenconsole: Allow non-interactive use
    
    If xenconsole is run with stdin closed or redirected to /dev/null,
    console_loop() will return immediately due to failure to read from
    STDIN_FILENO. This patch tests if stdin and stdout are both connected to
    a TTY and, if not, xenconsole will not attempt to read from stdin or
    modify stdout terminal attributes.
    
    Existing behaviour when xenconsole is run from a terminal does not
    change.
    
    This allows for non-interactive use, eg. running "xl create -c" under
    systemd or piping the output of "xl console" to another command.
    
    Signed-off-by: Martin Lucina <martin@lucina.net>
    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/console/client/main.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f4c783b..753b3aa 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -168,16 +168,19 @@ static void restore_term(int fd, struct termios *old)
 	tcsetattr(fd, TCSANOW, old);
 }
 
-static int console_loop(int fd, struct xs_handle *xs, char *pty_path)
+static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
+		        bool interactive)
 {
-	int ret, xs_fd = xs_fileno(xs), max_fd;
+	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
 
 	do {
 		fd_set fds;
 
 		FD_ZERO(&fds);
-		FD_SET(STDIN_FILENO, &fds);
-		max_fd = STDIN_FILENO;
+		if (interactive) {
+			FD_SET(STDIN_FILENO, &fds);
+			max_fd = STDIN_FILENO;
+		}
 		FD_SET(xs_fd, &fds);
 		if (xs_fd > max_fd) max_fd = xs_fd;
 		if (fd != -1) FD_SET(fd, &fds);
@@ -284,6 +287,10 @@ int main(int argc, char **argv)
 	struct xs_handle *xs;
 	char *end;
 	console_type type = CONSOLE_INVAL;
+	bool interactive = 0;
+
+	if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
+		interactive = 1;
 
 	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
 		switch(ch) {
@@ -390,9 +397,11 @@ int main(int argc, char **argv)
 	}
 
 	init_term(spty, &attr);
-	init_term(STDIN_FILENO, &stdin_old_attr);
-	atexit(restore_term_stdin); /* if this fails, oh dear */
-	console_loop(spty, xs, path);
+	if (interactive) {
+		init_term(STDIN_FILENO, &stdin_old_attr);
+		atexit(restore_term_stdin); /* if this fails, oh dear */
+	}
+	console_loop(spty, xs, path, interactive);
 
 	free(path);
 	free(dom_path);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:41:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZ9-0006TP-L6; Fri, 31 Jul 2015 13:41: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 1ZLAZ8-0006T4-GF
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:38 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F1/66-00536-E0B7BB55; Fri, 31 Jul 2015 13:41:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438350093!31096922!1
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 11804 invoked from network); 31 Jul 2015 13:41:34 -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;
	31 Jul 2015 13:41:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZ3-0004Xj-8C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZ3-0007DG-5R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:33 +0000
Date: Fri, 31 Jul 2015 13:41:33 +0000
Message-Id: <E1ZLAZ3-0007DG-5R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: helpers to pause a
	domain while in context
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aace3f16d23a8aab93b768b4655c138ff4ba0aa9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 24 13:23:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:23:59 2015 +0200

    common/domain: helpers to pause a domain while in context
    
    For use on codepaths which would need to use domain_pause() but might be in
    the target domain's context.  In the case that the target domain is in
    context, all other vcpus are paused.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/domain.c     |   28 ++++++++++++++++++++++++++++
 xen/include/xen/sched.h |    5 +++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 791166b..1b9fcfc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1010,6 +1010,34 @@ int domain_unpause_by_systemcontroller(struct domain *d)
     return 0;
 }
 
+void domain_pause_except_self(struct domain *d)
+{
+    struct vcpu *v, *curr = current;
+
+    if ( curr->domain == d )
+    {
+        for_each_vcpu( d, v )
+            if ( likely(v != curr) )
+                vcpu_pause(v);
+    }
+    else
+        domain_pause(d);
+}
+
+void domain_unpause_except_self(struct domain *d)
+{
+    struct vcpu *v, *curr = current;
+
+    if ( curr->domain == d )
+    {
+        for_each_vcpu( d, v )
+            if ( likely(v != curr) )
+                vcpu_unpause(v);
+    }
+    else
+        domain_unpause(d);
+}
+
 int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b29d9e7..73d3bc8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -804,6 +804,11 @@ static inline int domain_pause_by_systemcontroller_nosync(struct domain *d)
 {
     return __domain_pause_by_systemcontroller(d, domain_pause_nosync);
 }
+
+/* domain_pause() but safe against trying to pause current. */
+void domain_pause_except_self(struct domain *d);
+void domain_unpause_except_self(struct domain *d);
+
 void cpu_init(void);
 
 struct scheduler;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:41:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZ9-0006TP-L6; Fri, 31 Jul 2015 13:41: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 1ZLAZ8-0006T4-GF
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:38 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F1/66-00536-E0B7BB55; Fri, 31 Jul 2015 13:41:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1438350093!31096922!1
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 11804 invoked from network); 31 Jul 2015 13:41:34 -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;
	31 Jul 2015 13:41:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZ3-0004Xj-8C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZ3-0007DG-5R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:33 +0000
Date: Fri, 31 Jul 2015 13:41:33 +0000
Message-Id: <E1ZLAZ3-0007DG-5R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: helpers to pause a
	domain while in context
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aace3f16d23a8aab93b768b4655c138ff4ba0aa9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 24 13:23:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:23:59 2015 +0200

    common/domain: helpers to pause a domain while in context
    
    For use on codepaths which would need to use domain_pause() but might be in
    the target domain's context.  In the case that the target domain is in
    context, all other vcpus are paused.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/common/domain.c     |   28 ++++++++++++++++++++++++++++
 xen/include/xen/sched.h |    5 +++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 791166b..1b9fcfc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1010,6 +1010,34 @@ int domain_unpause_by_systemcontroller(struct domain *d)
     return 0;
 }
 
+void domain_pause_except_self(struct domain *d)
+{
+    struct vcpu *v, *curr = current;
+
+    if ( curr->domain == d )
+    {
+        for_each_vcpu( d, v )
+            if ( likely(v != curr) )
+                vcpu_pause(v);
+    }
+    else
+        domain_pause(d);
+}
+
+void domain_unpause_except_self(struct domain *d)
+{
+    struct vcpu *v, *curr = current;
+
+    if ( curr->domain == d )
+    {
+        for_each_vcpu( d, v )
+            if ( likely(v != curr) )
+                vcpu_unpause(v);
+    }
+    else
+        domain_unpause(d);
+}
+
 int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b29d9e7..73d3bc8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -804,6 +804,11 @@ static inline int domain_pause_by_systemcontroller_nosync(struct domain *d)
 {
     return __domain_pause_by_systemcontroller(d, domain_pause_nosync);
 }
+
+/* domain_pause() but safe against trying to pause current. */
+void domain_pause_except_self(struct domain *d);
+void domain_unpause_except_self(struct domain *d);
+
 void cpu_init(void);
 
 struct scheduler;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:41:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZH-0006Uz-NY; Fri, 31 Jul 2015 13:41: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 1ZLAZG-0006Ui-8g
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:46 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	C4/B5-09570-91B7BB55; Fri, 31 Jul 2015 13:41:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350103!29869266!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32613 invoked from network); 31 Jul 2015 13:41:44 -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;
	31 Jul 2015 13:41:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZD-0004Xr-DT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZD-0007Dc-C8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:43 +0000
Date: Fri, 31 Jul 2015 13:41:43 +0000
Message-Id: <E1ZLAZD-0007Dc-C8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: VMFUNC and #VE definitions and
	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 69b830e5ffb4f849902c724842aba98331b26d39
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:24:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:24:51 2015 +0200

    VMX: VMFUNC and #VE definitions and detection
    
    Currently, neither is enabled globally but may be enabled on a per-VCPU
    basis by the altp2m code.
    
    Remove the check for EPTE bit 63 == zero in ept_split_super_page(), as
    that bit is now hardware-defined.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   42 +++++++++++++++++++++++++++++++++--
 xen/arch/x86/mm/p2m-ept.c          |    1 -
 xen/include/asm-x86/hvm/vmx/vmcs.h |   14 ++++++++++-
 xen/include/asm-x86/hvm/vmx/vmx.h  |   13 ++++++++++-
 xen/include/asm-x86/msr-index.h    |    1 +
 5 files changed, 64 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4c5ceb5..bc1cabd 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -101,6 +101,8 @@ u32 vmx_secondary_exec_control __read_mostly;
 u32 vmx_vmexit_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 u64 vmx_ept_vpid_cap __read_mostly;
+u64 vmx_vmfunc __read_mostly;
+bool_t vmx_virt_exception __read_mostly;
 
 const u32 vmx_introspection_force_enabled_msrs[] = {
     MSR_IA32_SYSENTER_EIP,
@@ -140,6 +142,8 @@ static void __init vmx_display_features(void)
     P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
     P(cpu_has_vmx_posted_intr_processing, "Posted Interrupt Processing");
     P(cpu_has_vmx_vmcs_shadowing, "VMCS shadowing");
+    P(cpu_has_vmx_vmfunc, "VM Functions");
+    P(cpu_has_vmx_virt_exceptions, "Virtualisation Exceptions");
     P(cpu_has_vmx_pml, "Page Modification Logging");
 #undef P
 
@@ -185,6 +189,7 @@ static int vmx_init_vmcs_config(void)
     u64 _vmx_misc_cap = 0;
     u32 _vmx_vmexit_control;
     u32 _vmx_vmentry_control;
+    u64 _vmx_vmfunc = 0;
     bool_t mismatch = 0;
 
     rdmsr(MSR_IA32_VMX_BASIC, vmx_basic_msr_low, vmx_basic_msr_high);
@@ -230,7 +235,9 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_ENABLE_EPT |
                SECONDARY_EXEC_ENABLE_RDTSCP |
                SECONDARY_EXEC_PAUSE_LOOP_EXITING |
-               SECONDARY_EXEC_ENABLE_INVPCID);
+               SECONDARY_EXEC_ENABLE_INVPCID |
+               SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
+               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -341,6 +348,24 @@ static int vmx_init_vmcs_config(void)
           || !(_vmx_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT) )
         _vmx_pin_based_exec_control  &= ~ PIN_BASED_POSTED_INTERRUPT;
 
+    /* The IA32_VMX_VMFUNC MSR exists only when VMFUNC is available */
+    if ( _vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS )
+    {
+        rdmsrl(MSR_IA32_VMX_VMFUNC, _vmx_vmfunc);
+
+        /*
+         * VMFUNC leaf 0 (EPTP switching) must be supported.
+         *
+         * Or we just don't use VMFUNC.
+         */
+        if ( !(_vmx_vmfunc & VMX_VMFUNC_EPTP_SWITCHING) )
+            _vmx_secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_VM_FUNCTIONS;
+    }
+
+    /* Virtualization exceptions are only enabled if VMFUNC is enabled */
+    if ( !(_vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
+        _vmx_secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+
     min = 0;
     opt = VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_BNDCFGS;
     _vmx_vmentry_control = adjust_vmx_controls(
@@ -361,6 +386,9 @@ static int vmx_init_vmcs_config(void)
         vmx_vmentry_control        = _vmx_vmentry_control;
         vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
                                      vmx_basic_msr_low;
+        vmx_vmfunc                 = _vmx_vmfunc;
+        vmx_virt_exception         = !!(_vmx_secondary_exec_control &
+                                       SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
         vmx_display_features();
 
         /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
@@ -397,6 +425,9 @@ static int vmx_init_vmcs_config(void)
         mismatch |= cap_check(
             "EPT and VPID Capability",
             vmx_ept_vpid_cap, _vmx_ept_vpid_cap);
+        mismatch |= cap_check(
+            "VMFUNC Capability",
+            vmx_vmfunc, _vmx_vmfunc);
         if ( cpu_has_vmx_ins_outs_instr_info !=
              !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)) )
         {
@@ -967,6 +998,11 @@ static int construct_vmcs(struct vcpu *v)
     /* Do not enable Monitor Trap Flag unless start single step debug */
     v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
 
+    /* Disable VMFUNC and #VE for now: they may be enabled later by altp2m. */
+    v->arch.hvm_vmx.secondary_exec_control &=
+        ~(SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
+          SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
+
     if ( is_pvh_domain(d) )
     {
         /* Disable virtual apics, TPR */
@@ -1790,9 +1826,9 @@ void vmcs_dump_vcpu(struct vcpu *v)
         printk("PLE Gap=%08x Window=%08x\n",
                vmr32(PLE_GAP), vmr32(PLE_WINDOW));
     if ( v->arch.hvm_vmx.secondary_exec_control &
-         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VMFUNC) )
+         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
         printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n",
-               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VMFUNC_CONTROL));
+               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VM_FUNCTION_CONTROL));
 
     vmx_vmcs_exit(v);
 }
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e7ff739..9a3b65a 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -282,7 +282,6 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
         epte->sp = (level > 1);
         epte->mfn += i * trunk;
         epte->snp = (iommu_enabled && iommu_snoop);
-        ASSERT(!epte->avail3);
 
         ept_p2m_type_to_flags(p2m, epte, epte->sa_p2mt, epte->access);
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3132644..25ac8f7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -222,9 +222,10 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
-#define SECONDARY_EXEC_ENABLE_VMFUNC            0x00002000
+#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
+#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
@@ -285,6 +286,10 @@ extern u32 vmx_secondary_exec_control;
     (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
 #define cpu_has_vmx_vmcs_shadowing \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
+#define cpu_has_vmx_vmfunc \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS)
+#define cpu_has_vmx_virt_exceptions \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
 #define cpu_has_vmx_pml \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
 
@@ -316,6 +321,9 @@ extern u64 vmx_basic_msr;
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
 
+/* VMFUNC leaf definitions */
+#define VMX_VMFUNC_EPTP_SWITCHING   (1ULL << 0)
+
 /* VMCS field encodings. */
 #define VMCS_HIGH(x) ((x) | 1)
 enum vmcs_field {
@@ -350,12 +358,14 @@ enum vmcs_field {
     VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
     APIC_ACCESS_ADDR                = 0x00002014,
     PI_DESC_ADDR                    = 0x00002016,
-    VMFUNC_CONTROL                  = 0x00002018,
+    VM_FUNCTION_CONTROL             = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
     EOI_EXIT_BITMAP0                = 0x0000201c,
 #define EOI_EXIT_BITMAP(n) (EOI_EXIT_BITMAP0 + (n) * 2) /* n = 0...3 */
+    EPTP_LIST_ADDR                  = 0x00002024,
     VMREAD_BITMAP                   = 0x00002026,
     VMWRITE_BITMAP                  = 0x00002028,
+    VIRT_EXCEPTION_INFO             = 0x0000202a,
     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 c5f3d24..ee1cac7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -47,7 +47,7 @@ typedef union {
         access      :   4,  /* bits 61:58 - p2m_access_t */
         tm          :   1,  /* bit 62 - VT-d transient-mapping hint in
                                shared EPT/VT-d usage */
-        avail3      :   1;  /* bit 63 - Software available 3 */
+        suppress_ve :   1;  /* bit 63 - suppress #VE */
     };
     u64 epte;
 } ept_entry_t;
@@ -187,6 +187,7 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 #define EXIT_REASON_XSETBV              55
 #define EXIT_REASON_APIC_WRITE          56
 #define EXIT_REASON_INVPCID             58
+#define EXIT_REASON_VMFUNC              59
 #define EXIT_REASON_PML_FULL            62
 
 /*
@@ -555,4 +556,14 @@ void p2m_init_hap_data(struct p2m_domain *p2m);
 #define EPT_L4_PAGETABLE_SHIFT      39
 #define EPT_PAGETABLE_ENTRIES       512
 
+/* #VE information page */
+typedef struct {
+    u32 exit_reason;
+    u32 semaphore;
+    u64 exit_qualification;
+    u64 gla;
+    u64 gpa;
+    u16 eptp_index;
+} ve_info_t;
+
 #endif /* __ASM_X86_HVM_VMX_VMX_H__ */
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 5425f77..e9c4723 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -130,6 +130,7 @@
 #define MSR_IA32_VMX_TRUE_PROCBASED_CTLS        0x48e
 #define MSR_IA32_VMX_TRUE_EXIT_CTLS             0x48f
 #define MSR_IA32_VMX_TRUE_ENTRY_CTLS            0x490
+#define MSR_IA32_VMX_VMFUNC                     0x491
 #define IA32_FEATURE_CONTROL_MSR                0x3a
 #define IA32_FEATURE_CONTROL_MSR_LOCK                     0x0001
 #define IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX  0x0002
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:41:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZH-0006Uz-NY; Fri, 31 Jul 2015 13:41: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 1ZLAZG-0006Ui-8g
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:46 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	C4/B5-09570-91B7BB55; Fri, 31 Jul 2015 13:41:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350103!29869266!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32613 invoked from network); 31 Jul 2015 13:41:44 -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;
	31 Jul 2015 13:41:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZD-0004Xr-DT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZD-0007Dc-C8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:43 +0000
Date: Fri, 31 Jul 2015 13:41:43 +0000
Message-Id: <E1ZLAZD-0007Dc-C8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: VMFUNC and #VE definitions and
	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 69b830e5ffb4f849902c724842aba98331b26d39
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:24:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:24:51 2015 +0200

    VMX: VMFUNC and #VE definitions and detection
    
    Currently, neither is enabled globally but may be enabled on a per-VCPU
    basis by the altp2m code.
    
    Remove the check for EPTE bit 63 == zero in ept_split_super_page(), as
    that bit is now hardware-defined.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   42 +++++++++++++++++++++++++++++++++--
 xen/arch/x86/mm/p2m-ept.c          |    1 -
 xen/include/asm-x86/hvm/vmx/vmcs.h |   14 ++++++++++-
 xen/include/asm-x86/hvm/vmx/vmx.h  |   13 ++++++++++-
 xen/include/asm-x86/msr-index.h    |    1 +
 5 files changed, 64 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4c5ceb5..bc1cabd 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -101,6 +101,8 @@ u32 vmx_secondary_exec_control __read_mostly;
 u32 vmx_vmexit_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 u64 vmx_ept_vpid_cap __read_mostly;
+u64 vmx_vmfunc __read_mostly;
+bool_t vmx_virt_exception __read_mostly;
 
 const u32 vmx_introspection_force_enabled_msrs[] = {
     MSR_IA32_SYSENTER_EIP,
@@ -140,6 +142,8 @@ static void __init vmx_display_features(void)
     P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
     P(cpu_has_vmx_posted_intr_processing, "Posted Interrupt Processing");
     P(cpu_has_vmx_vmcs_shadowing, "VMCS shadowing");
+    P(cpu_has_vmx_vmfunc, "VM Functions");
+    P(cpu_has_vmx_virt_exceptions, "Virtualisation Exceptions");
     P(cpu_has_vmx_pml, "Page Modification Logging");
 #undef P
 
@@ -185,6 +189,7 @@ static int vmx_init_vmcs_config(void)
     u64 _vmx_misc_cap = 0;
     u32 _vmx_vmexit_control;
     u32 _vmx_vmentry_control;
+    u64 _vmx_vmfunc = 0;
     bool_t mismatch = 0;
 
     rdmsr(MSR_IA32_VMX_BASIC, vmx_basic_msr_low, vmx_basic_msr_high);
@@ -230,7 +235,9 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_ENABLE_EPT |
                SECONDARY_EXEC_ENABLE_RDTSCP |
                SECONDARY_EXEC_PAUSE_LOOP_EXITING |
-               SECONDARY_EXEC_ENABLE_INVPCID);
+               SECONDARY_EXEC_ENABLE_INVPCID |
+               SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
+               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -341,6 +348,24 @@ static int vmx_init_vmcs_config(void)
           || !(_vmx_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT) )
         _vmx_pin_based_exec_control  &= ~ PIN_BASED_POSTED_INTERRUPT;
 
+    /* The IA32_VMX_VMFUNC MSR exists only when VMFUNC is available */
+    if ( _vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS )
+    {
+        rdmsrl(MSR_IA32_VMX_VMFUNC, _vmx_vmfunc);
+
+        /*
+         * VMFUNC leaf 0 (EPTP switching) must be supported.
+         *
+         * Or we just don't use VMFUNC.
+         */
+        if ( !(_vmx_vmfunc & VMX_VMFUNC_EPTP_SWITCHING) )
+            _vmx_secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_VM_FUNCTIONS;
+    }
+
+    /* Virtualization exceptions are only enabled if VMFUNC is enabled */
+    if ( !(_vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
+        _vmx_secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+
     min = 0;
     opt = VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_BNDCFGS;
     _vmx_vmentry_control = adjust_vmx_controls(
@@ -361,6 +386,9 @@ static int vmx_init_vmcs_config(void)
         vmx_vmentry_control        = _vmx_vmentry_control;
         vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
                                      vmx_basic_msr_low;
+        vmx_vmfunc                 = _vmx_vmfunc;
+        vmx_virt_exception         = !!(_vmx_secondary_exec_control &
+                                       SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
         vmx_display_features();
 
         /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
@@ -397,6 +425,9 @@ static int vmx_init_vmcs_config(void)
         mismatch |= cap_check(
             "EPT and VPID Capability",
             vmx_ept_vpid_cap, _vmx_ept_vpid_cap);
+        mismatch |= cap_check(
+            "VMFUNC Capability",
+            vmx_vmfunc, _vmx_vmfunc);
         if ( cpu_has_vmx_ins_outs_instr_info !=
              !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)) )
         {
@@ -967,6 +998,11 @@ static int construct_vmcs(struct vcpu *v)
     /* Do not enable Monitor Trap Flag unless start single step debug */
     v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
 
+    /* Disable VMFUNC and #VE for now: they may be enabled later by altp2m. */
+    v->arch.hvm_vmx.secondary_exec_control &=
+        ~(SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
+          SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
+
     if ( is_pvh_domain(d) )
     {
         /* Disable virtual apics, TPR */
@@ -1790,9 +1826,9 @@ void vmcs_dump_vcpu(struct vcpu *v)
         printk("PLE Gap=%08x Window=%08x\n",
                vmr32(PLE_GAP), vmr32(PLE_WINDOW));
     if ( v->arch.hvm_vmx.secondary_exec_control &
-         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VMFUNC) )
+         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
         printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n",
-               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VMFUNC_CONTROL));
+               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VM_FUNCTION_CONTROL));
 
     vmx_vmcs_exit(v);
 }
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e7ff739..9a3b65a 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -282,7 +282,6 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
         epte->sp = (level > 1);
         epte->mfn += i * trunk;
         epte->snp = (iommu_enabled && iommu_snoop);
-        ASSERT(!epte->avail3);
 
         ept_p2m_type_to_flags(p2m, epte, epte->sa_p2mt, epte->access);
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3132644..25ac8f7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -222,9 +222,10 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
-#define SECONDARY_EXEC_ENABLE_VMFUNC            0x00002000
+#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
+#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
@@ -285,6 +286,10 @@ extern u32 vmx_secondary_exec_control;
     (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
 #define cpu_has_vmx_vmcs_shadowing \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
+#define cpu_has_vmx_vmfunc \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS)
+#define cpu_has_vmx_virt_exceptions \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
 #define cpu_has_vmx_pml \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
 
@@ -316,6 +321,9 @@ extern u64 vmx_basic_msr;
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
 
+/* VMFUNC leaf definitions */
+#define VMX_VMFUNC_EPTP_SWITCHING   (1ULL << 0)
+
 /* VMCS field encodings. */
 #define VMCS_HIGH(x) ((x) | 1)
 enum vmcs_field {
@@ -350,12 +358,14 @@ enum vmcs_field {
     VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
     APIC_ACCESS_ADDR                = 0x00002014,
     PI_DESC_ADDR                    = 0x00002016,
-    VMFUNC_CONTROL                  = 0x00002018,
+    VM_FUNCTION_CONTROL             = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
     EOI_EXIT_BITMAP0                = 0x0000201c,
 #define EOI_EXIT_BITMAP(n) (EOI_EXIT_BITMAP0 + (n) * 2) /* n = 0...3 */
+    EPTP_LIST_ADDR                  = 0x00002024,
     VMREAD_BITMAP                   = 0x00002026,
     VMWRITE_BITMAP                  = 0x00002028,
+    VIRT_EXCEPTION_INFO             = 0x0000202a,
     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 c5f3d24..ee1cac7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -47,7 +47,7 @@ typedef union {
         access      :   4,  /* bits 61:58 - p2m_access_t */
         tm          :   1,  /* bit 62 - VT-d transient-mapping hint in
                                shared EPT/VT-d usage */
-        avail3      :   1;  /* bit 63 - Software available 3 */
+        suppress_ve :   1;  /* bit 63 - suppress #VE */
     };
     u64 epte;
 } ept_entry_t;
@@ -187,6 +187,7 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 #define EXIT_REASON_XSETBV              55
 #define EXIT_REASON_APIC_WRITE          56
 #define EXIT_REASON_INVPCID             58
+#define EXIT_REASON_VMFUNC              59
 #define EXIT_REASON_PML_FULL            62
 
 /*
@@ -555,4 +556,14 @@ void p2m_init_hap_data(struct p2m_domain *p2m);
 #define EPT_L4_PAGETABLE_SHIFT      39
 #define EPT_PAGETABLE_ENTRIES       512
 
+/* #VE information page */
+typedef struct {
+    u32 exit_reason;
+    u32 semaphore;
+    u64 exit_qualification;
+    u64 gla;
+    u64 gpa;
+    u16 eptp_index;
+} ve_info_t;
+
 #endif /* __ASM_X86_HVM_VMX_VMX_H__ */
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 5425f77..e9c4723 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -130,6 +130,7 @@
 #define MSR_IA32_VMX_TRUE_PROCBASED_CTLS        0x48e
 #define MSR_IA32_VMX_TRUE_EXIT_CTLS             0x48f
 #define MSR_IA32_VMX_TRUE_ENTRY_CTLS            0x490
+#define MSR_IA32_VMX_VMFUNC                     0x491
 #define IA32_FEATURE_CONTROL_MSR                0x3a
 #define IA32_FEATURE_CONTROL_MSR_LOCK                     0x0001
 #define IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX  0x0002
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:41:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZR-0006Wp-S5; Fri, 31 Jul 2015 13:41:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZQ-0006We-9k
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:56 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	E7/65-19110-32B7BB55; Fri, 31 Jul 2015 13:41:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438350113!36865439!1
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 8306 invoked from network); 31 Jul 2015 13:41:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:41:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZN-0004Xz-Kg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZN-0007E6-Hz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:53 +0000
Date: Fri, 31 Jul 2015 13:41:53 +0000
Message-Id: <E1ZLAZN-0007E6-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: implement suppress #VE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a2903e779d2f3fb7511a483f87b7dc152c5e441
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:25:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:25:29 2015 +0200

    VMX: implement suppress #VE
    
    In preparation for selectively enabling #VE in a later patch, set
    suppress #VE on all EPTE's.
    
    Suppress #VE should always be the default condition for two reasons:
    it is generally not safe to deliver #VE into a guest unless that guest
    has been modified to receive it; and even then for most EPT violations only
    the hypervisor is able to handle the violation.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9a3b65a..b532811 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -42,7 +42,8 @@
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
 static inline bool_t is_epte_valid(ept_entry_t *e)
 {
-    return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
+    /* suppress_ve alone is not considered valid, so mask it off */
+    return ((e->epte & ~(1ul << 63)) != 0 && e->sa_p2mt != p2m_invalid);
 }
 
 /* returns : 0 for success, -errno otherwise */
@@ -220,6 +221,8 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
 static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 {
     struct page_info *pg;
+    ept_entry_t *table;
+    unsigned int i;
 
     pg = p2m_alloc_ptp(p2m, 0);
     if ( pg == NULL )
@@ -233,6 +236,15 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
     ept_entry->a = 1;
 
+    ept_entry->suppress_ve = 1;
+
+    table = __map_domain_page(pg);
+
+    for ( i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
+        table[i].suppress_ve = 1;
+
+    unmap_domain_page(table);
+
     return 1;
 }
 
@@ -282,6 +294,7 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
         epte->sp = (level > 1);
         epte->mfn += i * trunk;
         epte->snp = (iommu_enabled && iommu_snoop);
+        epte->suppress_ve = 1;
 
         ept_p2m_type_to_flags(p2m, epte, epte->sa_p2mt, epte->access);
 
@@ -791,6 +804,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
 
+    new_entry.suppress_ve = 1;
+
     rc = atomic_write_ept_entry(ept_entry, new_entry, target);
     if ( unlikely(rc) )
         old_entry.epte = 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 Jul 31 13:41:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:41: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 1ZLAZR-0006Wp-S5; Fri, 31 Jul 2015 13:41:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZQ-0006We-9k
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:56 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	E7/65-19110-32B7BB55; Fri, 31 Jul 2015 13:41:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438350113!36865439!1
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 8306 invoked from network); 31 Jul 2015 13:41:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:41:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZN-0004Xz-Kg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZN-0007E6-Hz
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:41:53 +0000
Date: Fri, 31 Jul 2015 13:41:53 +0000
Message-Id: <E1ZLAZN-0007E6-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: implement suppress #VE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a2903e779d2f3fb7511a483f87b7dc152c5e441
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:25:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:25:29 2015 +0200

    VMX: implement suppress #VE
    
    In preparation for selectively enabling #VE in a later patch, set
    suppress #VE on all EPTE's.
    
    Suppress #VE should always be the default condition for two reasons:
    it is generally not safe to deliver #VE into a guest unless that guest
    has been modified to receive it; and even then for most EPT violations only
    the hypervisor is able to handle the violation.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9a3b65a..b532811 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -42,7 +42,8 @@
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
 static inline bool_t is_epte_valid(ept_entry_t *e)
 {
-    return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
+    /* suppress_ve alone is not considered valid, so mask it off */
+    return ((e->epte & ~(1ul << 63)) != 0 && e->sa_p2mt != p2m_invalid);
 }
 
 /* returns : 0 for success, -errno otherwise */
@@ -220,6 +221,8 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
 static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 {
     struct page_info *pg;
+    ept_entry_t *table;
+    unsigned int i;
 
     pg = p2m_alloc_ptp(p2m, 0);
     if ( pg == NULL )
@@ -233,6 +236,15 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
     ept_entry->a = 1;
 
+    ept_entry->suppress_ve = 1;
+
+    table = __map_domain_page(pg);
+
+    for ( i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
+        table[i].suppress_ve = 1;
+
+    unmap_domain_page(table);
+
     return 1;
 }
 
@@ -282,6 +294,7 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
         epte->sp = (level > 1);
         epte->mfn += i * trunk;
         epte->snp = (iommu_enabled && iommu_snoop);
+        epte->suppress_ve = 1;
 
         ept_p2m_type_to_flags(p2m, epte, epte->sa_p2mt, epte->access);
 
@@ -791,6 +804,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
 
+    new_entry.suppress_ve = 1;
+
     rc = atomic_write_ept_entry(ept_entry, new_entry, target);
     if ( unlikely(rc) )
         old_entry.epte = 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 Jul 31 13:42:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAZg-0006YU-Ur; Fri, 31 Jul 2015 13:42:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZf-0006YN-Fd
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:11 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	BB/00-28791-23B7BB55; Fri, 31 Jul 2015 13:42:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1438350129!36838668!1
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 15962 invoked from network); 31 Jul 2015 13:42:09 -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;
	31 Jul 2015 13:42:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZc-0004Yb-T8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZX-0007Ej-Pn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:03 +0000
Date: Fri, 31 Jul 2015 13:42:03 +0000
Message-Id: <E1ZLAZX-0007Ej-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: hardware alternate p2m
	support 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 fce42d9ad7ae204204f56ad5e4324c20f2acc925
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:26:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:26:02 2015 +0200

    x86/HVM: hardware alternate p2m support detection
    
    As implemented here, only supported on platforms with VMX HAP.
    
    By default this functionality is force-disabled, it can be enabled
    by specifying altp2m=1 on the Xen command line.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/misc/xen-command-line.markdown |    7 +++++++
 xen/arch/x86/hvm/hvm.c              |    7 +++++++
 xen/arch/x86/hvm/vmx/vmx.c          |    1 +
 xen/include/asm-x86/hvm/hvm.h       |    9 +++++++++
 4 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a1bca2b..204e7a4 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -140,6 +140,13 @@ mode during S3 resume.
 
 Permit Xen to use superpages when performing memory management.
 
+### altp2m (Intel)
+> `= <boolean>`
+
+> Default: `false`
+
+Permit multiple copies of host p2m.
+
 ### apic
 > `= bigsmp | default`
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d860579..9de6c66 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -96,6 +96,10 @@ bool_t opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
 #endif
 
+/* Xen command-line option to enable altp2m */
+static bool_t __initdata opt_altp2m_enabled = 0;
+boolean_param("altp2m", opt_altp2m_enabled);
+
 static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -162,6 +166,9 @@ static int __init hvm_enable(void)
     if ( !fns->pvh_supported )
         printk(XENLOG_INFO "HVM: PVH mode not supported on this platform\n");
 
+    if ( !opt_altp2m_enabled )
+        hvm_funcs.altp2m_supported = 0;
+
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
      * often used for I/O delays, but the vmexits simply slow things down).
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d3183a8..4f8b0e0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1847,6 +1847,7 @@ const struct hvm_function_table * __init start_vmx(void)
     if ( cpu_has_vmx_ept && (cpu_has_vmx_pat || opt_force_ept) )
     {
         vmx_function_table.hap_supported = 1;
+        vmx_function_table.altp2m_supported = 1;
 
         vmx_function_table.hap_capabilities = 0;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 82f1b32..3a94f8c 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -94,6 +94,9 @@ struct hvm_function_table {
     /* Necessary hardware support for PVH mode? */
     int pvh_supported;
 
+    /* Necessary hardware support for alternate p2m's? */
+    bool_t altp2m_supported;
+
     /* Indicate HAP capabilities. */
     int hap_capabilities;
 
@@ -530,6 +533,12 @@ static inline bool_t hvm_is_singlestep_supported(void)
             hvm_funcs.is_singlestep_supported());
 }
 
+/* returns true if hardware supports alternate p2m's */
+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;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAZg-0006YU-Ur; Fri, 31 Jul 2015 13:42:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZf-0006YN-Fd
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:11 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	BB/00-28791-23B7BB55; Fri, 31 Jul 2015 13:42:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1438350129!36838668!1
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 15962 invoked from network); 31 Jul 2015 13:42:09 -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;
	31 Jul 2015 13:42:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZc-0004Yb-T8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZX-0007Ej-Pn
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:03 +0000
Date: Fri, 31 Jul 2015 13:42:03 +0000
Message-Id: <E1ZLAZX-0007Ej-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: hardware alternate p2m
	support 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 fce42d9ad7ae204204f56ad5e4324c20f2acc925
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:26:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:26:02 2015 +0200

    x86/HVM: hardware alternate p2m support detection
    
    As implemented here, only supported on platforms with VMX HAP.
    
    By default this functionality is force-disabled, it can be enabled
    by specifying altp2m=1 on the Xen command line.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/misc/xen-command-line.markdown |    7 +++++++
 xen/arch/x86/hvm/hvm.c              |    7 +++++++
 xen/arch/x86/hvm/vmx/vmx.c          |    1 +
 xen/include/asm-x86/hvm/hvm.h       |    9 +++++++++
 4 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a1bca2b..204e7a4 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -140,6 +140,13 @@ mode during S3 resume.
 
 Permit Xen to use superpages when performing memory management.
 
+### altp2m (Intel)
+> `= <boolean>`
+
+> Default: `false`
+
+Permit multiple copies of host p2m.
+
 ### apic
 > `= bigsmp | default`
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d860579..9de6c66 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -96,6 +96,10 @@ bool_t opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
 #endif
 
+/* Xen command-line option to enable altp2m */
+static bool_t __initdata opt_altp2m_enabled = 0;
+boolean_param("altp2m", opt_altp2m_enabled);
+
 static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -162,6 +166,9 @@ static int __init hvm_enable(void)
     if ( !fns->pvh_supported )
         printk(XENLOG_INFO "HVM: PVH mode not supported on this platform\n");
 
+    if ( !opt_altp2m_enabled )
+        hvm_funcs.altp2m_supported = 0;
+
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
      * often used for I/O delays, but the vmexits simply slow things down).
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d3183a8..4f8b0e0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1847,6 +1847,7 @@ const struct hvm_function_table * __init start_vmx(void)
     if ( cpu_has_vmx_ept && (cpu_has_vmx_pat || opt_force_ept) )
     {
         vmx_function_table.hap_supported = 1;
+        vmx_function_table.altp2m_supported = 1;
 
         vmx_function_table.hap_capabilities = 0;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 82f1b32..3a94f8c 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -94,6 +94,9 @@ struct hvm_function_table {
     /* Necessary hardware support for PVH mode? */
     int pvh_supported;
 
+    /* Necessary hardware support for alternate p2m's? */
+    bool_t altp2m_supported;
+
     /* Indicate HAP capabilities. */
     int hap_capabilities;
 
@@ -530,6 +533,12 @@ static inline bool_t hvm_is_singlestep_supported(void)
             hvm_funcs.is_singlestep_supported());
 }
 
+/* returns true if hardware supports alternate p2m's */
+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;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAZs-0006Zp-1E; Fri, 31 Jul 2015 13:42: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 1ZLAZq-0006Zi-G7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:22 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	C7/84-03763-D3B7BB55; Fri, 31 Jul 2015 13:42:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350139!29869474!1
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 5623 invoked from network); 31 Jul 2015 13:42:20 -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;
	31 Jul 2015 13:42:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZn-0004Yn-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZn-0007FT-68
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:19 +0000
Date: Fri, 31 Jul 2015 13:42:19 +0000
Message-Id: <E1ZLAZn-0007FT-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: basic data structures and
	support routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d39a32e701cbc4668378caebed0de46f0ed1208c
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:28:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:28:00 2015 +0200

    x86/altp2m: basic data structures and support routines
    
    Add the basic data structures needed to support alternate p2m's and
    the functions to initialise them and tear them down.
    
    Although Intel hardware can handle 512 EPTP's per hardware thread
    concurrently, only 10 per domain are supported in this patch for
    performance reasons.
    
    This change also splits the p2m lock into one lock type for altp2m's
    and another type for all other p2m's. The purpose of this is to place
    the altp2m list lock between the types, so the list lock can be
    acquired whilst holding the host p2m lock.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    
    Cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c         |   21 ++++++++
 xen/arch/x86/mm/Makefile       |    1 +
 xen/arch/x86/mm/altp2m.c       |   77 ++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c      |   40 +++++++++++++++-
 xen/arch/x86/mm/mm-locks.h     |   46 +++++++++++++++++-
 xen/arch/x86/mm/p2m.c          |  101 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/altp2m.h   |   38 +++++++++++++++
 xen/include/asm-x86/domain.h   |   10 ++++
 xen/include/asm-x86/hvm/hvm.h  |   14 ++++++
 xen/include/asm-x86/hvm/vcpu.h |    9 ++++
 xen/include/asm-x86/p2m.h      |   34 +++++++++++++-
 11 files changed, 386 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9de6c66..8c2ace1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -61,6 +61,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/event.h>
 #include <asm/hvm/vmx/vmx.h>
+#include <asm/altp2m.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -2462,6 +2463,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     hvm_all_ioreq_servers_remove_vcpu(v->domain, v);
 
+    altp2m_vcpu_destroy(v);
     nestedhvm_vcpu_destroy(v);
 
     free_compat_arg_xlat(v);
@@ -6567,6 +6569,25 @@ void hvm_toggle_singlestep(struct vcpu *v)
     v->arch.hvm_vcpu.single_step = !v->arch.hvm_vcpu.single_step;
 }
 
+void altp2m_vcpu_update_p2m(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_update_p2m )
+        hvm_funcs.altp2m_vcpu_update_p2m(v);
+}
+
+void altp2m_vcpu_update_vmfunc_ve(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_update_vmfunc_ve )
+        hvm_funcs.altp2m_vcpu_update_vmfunc_ve(v);
+}
+
+bool_t altp2m_vcpu_emulate_ve(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_emulate_ve )
+        return hvm_funcs.altp2m_vcpu_emulate_ve(v);
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index ed4b1f8..aeccdfc 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -3,6 +3,7 @@ subdir-y += hap
 
 obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
+obj-y += altp2m.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
 obj-$(x86_64) += guest_walk_4.o
diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
new file mode 100644
index 0000000..17b227c
--- /dev/null
+++ b/xen/arch/x86/mm/altp2m.c
@@ -0,0 +1,77 @@
+/*
+ * Alternate p2m HVM
+ * Copyright (c) 2014, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include <asm/hvm/support.h>
+#include <asm/hvm/hvm.h>
+#include <asm/p2m.h>
+#include <asm/altp2m.h>
+
+void
+altp2m_vcpu_reset(struct vcpu *v)
+{
+    struct altp2mvcpu *av = &vcpu_altp2m(v);
+
+    av->p2midx = INVALID_ALTP2M;
+    av->veinfo_gfn = _gfn(INVALID_GFN);
+}
+
+void
+altp2m_vcpu_initialise(struct vcpu *v)
+{
+    if ( v != current )
+        vcpu_pause(v);
+
+    altp2m_vcpu_reset(v);
+    vcpu_altp2m(v).p2midx = 0;
+    atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+
+    altp2m_vcpu_update_p2m(v);
+
+    if ( v != current )
+        vcpu_unpause(v);
+}
+
+void
+altp2m_vcpu_destroy(struct vcpu *v)
+{
+    struct p2m_domain *p2m;
+
+    if ( v != current )
+        vcpu_pause(v);
+
+    if ( (p2m = p2m_get_altp2m(v)) )
+        atomic_dec(&p2m->active_vcpus);
+
+    altp2m_vcpu_reset(v);
+
+    altp2m_vcpu_update_p2m(v);
+    altp2m_vcpu_update_vmfunc_ve(v);
+
+    if ( v != current )
+        vcpu_unpause(v);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 63980af..2d5f6b3 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -459,7 +459,7 @@ void hap_domain_init(struct domain *d)
 int hap_enable(struct domain *d, u32 mode)
 {
     unsigned int old_pages;
-    uint8_t i;
+    unsigned int i;
     int rv = 0;
 
     domain_pause(d);
@@ -498,6 +498,28 @@ int hap_enable(struct domain *d, u32 mode)
            goto out;
     }
 
+    if ( hvm_altp2m_supported() )
+    {
+        /* Init alternate p2m data */
+        if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL )
+        {
+            rv = -ENOMEM;
+            goto out;
+        }
+
+        for ( i = 0; i < MAX_EPTP; i++ )
+            d->arch.altp2m_eptp[i] = INVALID_MFN;
+
+        for ( i = 0; i < MAX_ALTP2M; i++ )
+        {
+            rv = p2m_alloc_table(d->arch.altp2m_p2m[i]);
+            if ( rv != 0 )
+               goto out;
+        }
+
+        d->arch.altp2m_active = 0;
+    }
+
     /* Now let other users see the new mode */
     d->arch.paging.mode = mode | PG_HAP_enable;
 
@@ -508,7 +530,21 @@ int hap_enable(struct domain *d, u32 mode)
 
 void hap_final_teardown(struct domain *d)
 {
-    uint8_t i;
+    unsigned int i;
+
+    if ( hvm_altp2m_supported() )
+    {
+        d->arch.altp2m_active = 0;
+
+        if ( d->arch.altp2m_eptp )
+        {
+            free_xenheap_page(d->arch.altp2m_eptp);
+            d->arch.altp2m_eptp = NULL;
+        }
+
+        for ( i = 0; i < MAX_ALTP2M; i++ )
+            p2m_teardown(d->arch.altp2m_p2m[i]);
+    }
 
     /* Destroy nestedp2m's first */
     for (i = 0; i < MAX_NESTEDP2M; i++) {
diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index b4f035e..c66f105 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -217,7 +217,7 @@ declare_mm_lock(nestedp2m)
 #define nestedp2m_lock(d)   mm_lock(nestedp2m, &(d)->arch.nested_p2m_lock)
 #define nestedp2m_unlock(d) mm_unlock(&(d)->arch.nested_p2m_lock)
 
-/* P2M lock (per-p2m-table)
+/* P2M lock (per-non-alt-p2m-table)
  *
  * This protects all queries and updates to the p2m table.
  * Queries may be made under the read lock but all modifications
@@ -225,10 +225,52 @@ declare_mm_lock(nestedp2m)
  *
  * The write lock is recursive as it is common for a code path to look
  * up a gfn and later mutate it.
+ *
+ * Note that this lock shares its implementation with the altp2m
+ * lock (not the altp2m list lock), so the implementation
+ * is found there.
+ *
+ * Changes made to the host p2m when in altp2m mode are propagated to the
+ * altp2ms synchronously in ept_set_entry().  At that point, we will hold
+ * the host p2m lock; propagating this change involves grabbing the
+ * altp2m_list lock, and the locks of the individual alternate p2ms.  In
+ * order to allow us to maintain locking order discipline, we split the p2m
+ * lock into p2m (for host p2ms) and altp2m (for alternate p2ms), putting
+ * the altp2mlist lock in the middle.
  */
 
 declare_mm_rwlock(p2m);
-#define p2m_lock(p)           mm_write_lock(p2m, &(p)->lock);
+
+/* Alternate P2M list lock (per-domain)
+ *
+ * A per-domain lock that protects the list of alternate p2m's.
+ * Any operation that walks the list needs to acquire this lock.
+ * Additionally, before destroying an alternate p2m all VCPU's
+ * in the target domain must be paused.
+ */
+
+declare_mm_lock(altp2mlist)
+#define altp2m_list_lock(d)   mm_lock(altp2mlist, &(d)->arch.altp2m_list_lock)
+#define altp2m_list_unlock(d) mm_unlock(&(d)->arch.altp2m_list_lock)
+
+/* P2M lock (per-altp2m-table)
+ *
+ * This protects all queries and updates to the p2m table.
+ * Queries may be made under the read lock but all modifications
+ * need the main (write) lock.
+ *
+ * The write lock is recursive as it is common for a code path to look
+ * up a gfn and later mutate it.
+ */
+
+declare_mm_rwlock(altp2m);
+#define p2m_lock(p)                         \
+{                                           \
+    if ( p2m_is_altp2m(p) )                 \
+        mm_write_lock(altp2m, &(p)->lock);  \
+    else                                    \
+        mm_write_lock(p2m, &(p)->lock);     \
+}
 #define p2m_unlock(p)         mm_write_unlock(&(p)->lock);
 #define gfn_lock(p,g,o)       p2m_lock(p)
 #define gfn_unlock(p,g,o)     p2m_unlock(p)
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 89616b7..e4a3f4a 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -35,6 +35,7 @@
 #include <asm/hvm/vmx/vmx.h> /* ept_p2m_init() */
 #include <asm/mem_sharing.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/altp2m.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
 #include <xsm/xsm.h>
 
@@ -183,6 +184,43 @@ static void p2m_teardown_nestedp2m(struct domain *d)
     }
 }
 
+static void p2m_teardown_altp2m(struct domain *d)
+{
+    unsigned int i;
+    struct p2m_domain *p2m;
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( !d->arch.altp2m_p2m[i] )
+            continue;
+        p2m = d->arch.altp2m_p2m[i];
+        d->arch.altp2m_p2m[i] = NULL;
+        p2m_free_one(p2m);
+    }
+}
+
+static int p2m_init_altp2m(struct domain *d)
+{
+    unsigned int i;
+    struct p2m_domain *p2m;
+
+    mm_lock_init(&d->arch.altp2m_list_lock);
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        d->arch.altp2m_p2m[i] = p2m = p2m_init_one(d);
+        if ( p2m == NULL )
+        {
+            p2m_teardown_altp2m(d);
+            return -ENOMEM;
+        }
+        p2m->p2m_class = p2m_alternate;
+        p2m->access_required = 1;
+        _atomic_set(&p2m->active_vcpus, 0);
+    }
+
+    return 0;
+}
+
 int p2m_init(struct domain *d)
 {
     int rc;
@@ -196,7 +234,17 @@ int p2m_init(struct domain *d)
      * (p2m_init runs too early for HVM_PARAM_* options) */
     rc = p2m_init_nestedp2m(d);
     if ( rc )
+    {
+        p2m_teardown_hostp2m(d);
+        return rc;
+    }
+
+    rc = p2m_init_altp2m(d);
+    if ( rc )
+    {
         p2m_teardown_hostp2m(d);
+        p2m_teardown_nestedp2m(d);
+    }
 
     return rc;
 }
@@ -1979,6 +2027,59 @@ int unmap_mmio_regions(struct domain *d,
     return err;
 }
 
+unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp)
+{
+    struct p2m_domain *p2m;
+    struct ept_data *ept;
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] == INVALID_MFN )
+            continue;
+
+        p2m = d->arch.altp2m_p2m[i];
+        ept = &p2m->ept;
+
+        if ( eptp == ept_get_eptp(ept) )
+            goto out;
+    }
+
+    i = INVALID_ALTP2M;
+
+ out:
+    altp2m_list_unlock(d);
+    return i;
+}
+
+bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
+{
+    struct domain *d = v->domain;
+    bool_t rc = 0;
+
+    if ( idx > MAX_ALTP2M )
+        return rc;
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        if ( idx != vcpu_altp2m(v).p2midx )
+        {
+            atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+            vcpu_altp2m(v).p2midx = idx;
+            atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+            altp2m_vcpu_update_p2m(v);
+        }
+        rc = 1;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
 /*** Audit ***/
 
 #if P2M_AUDIT
diff --git a/xen/include/asm-x86/altp2m.h b/xen/include/asm-x86/altp2m.h
new file mode 100644
index 0000000..9e1739d
--- /dev/null
+++ b/xen/include/asm-x86/altp2m.h
@@ -0,0 +1,38 @@
+/*
+ * Alternate p2m HVM
+ * Copyright (c) 2014, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _X86_ALTP2M_H
+#define _X86_ALTP2M_H
+
+#include <xen/types.h>
+#include <xen/sched.h>         /* for struct vcpu, struct domain */
+#include <asm/hvm/vcpu.h>      /* for vcpu_altp2m */
+
+/* Alternate p2m HVM on/off per domain */
+static inline bool_t altp2m_active(const struct domain *d)
+{
+    return d->arch.altp2m_active;
+}
+
+/* Alternate p2m VCPU */
+void altp2m_vcpu_initialise(struct vcpu *v);
+void altp2m_vcpu_destroy(struct vcpu *v);
+void altp2m_vcpu_reset(struct vcpu *v);
+
+#endif /* _X86_ALTP2M_H */
+
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 7a9e96f..0fce09e 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -233,6 +233,10 @@ struct paging_vcpu {
 typedef xen_domctl_cpuid_t cpuid_input_t;
 
 #define MAX_NESTEDP2M 10
+
+#define MAX_ALTP2M      10 /* arbitrary */
+#define INVALID_ALTP2M  0xffff
+#define MAX_EPTP        (PAGE_SIZE / sizeof(uint64_t))
 struct p2m_domain;
 struct time_scale {
     int shift;
@@ -307,6 +311,12 @@ struct arch_domain
     struct p2m_domain *nested_p2m[MAX_NESTEDP2M];
     mm_lock_t nested_p2m_lock;
 
+    /* altp2m: allow multiple copies of host p2m */
+    bool_t altp2m_active;
+    struct p2m_domain *altp2m_p2m[MAX_ALTP2M];
+    mm_lock_t altp2m_list_lock;
+    uint64_t *altp2m_eptp;
+
     /* NB. protected by d->event_lock and by irq_desc[irq].lock */
     struct radix_tree_root irq_pirq;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 3a94f8c..0de061a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -206,6 +206,11 @@ struct hvm_function_table {
 
     void (*enable_msr_exit_interception)(struct domain *d);
     bool_t (*is_singlestep_supported)(void);
+
+    /* Alternate p2m */
+    void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
+    void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
+    bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -546,6 +551,15 @@ extern bool_t opt_hvm_fep;
 #define opt_hvm_fep 0
 #endif
 
+/* updates the current hardware p2m */
+void altp2m_vcpu_update_p2m(struct vcpu *v);
+
+/* updates VMCS fields related to VMFUNC and #VE */
+void altp2m_vcpu_update_vmfunc_ve(struct vcpu *v);
+
+/* emulates #VE */
+bool_t altp2m_vcpu_emulate_ve(struct vcpu *v);
+
 #endif /* __ASM_X86_HVM_HVM_H__ */
 
 /*
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 0df4524..c033c8c 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -135,6 +135,13 @@ struct nestedvcpu {
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
 
+struct altp2mvcpu {
+    uint16_t    p2midx;         /* alternate p2m index */
+    gfn_t       veinfo_gfn;     /* #VE information page gfn */
+};
+
+#define vcpu_altp2m(v) ((v)->arch.hvm_vcpu.avcpu)
+
 struct hvm_vcpu {
     /* Guest control-register and EFER values, just as the guest sees them. */
     unsigned long       guest_cr[5];
@@ -177,6 +184,8 @@ struct hvm_vcpu {
 
     struct nestedvcpu   nvcpu;
 
+    struct altp2mvcpu   avcpu;
+
     struct mtrr_state   mtrr;
     u64                 pat_cr;
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 68da0a9..b6539c8 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -175,6 +175,7 @@ typedef unsigned int p2m_query_t;
 typedef enum {
     p2m_host,
     p2m_nested,
+    p2m_alternate,
 } p2m_class_t;
 
 /* Per-p2m-table state */
@@ -193,7 +194,7 @@ struct p2m_domain {
 
     struct domain     *domain;   /* back pointer to domain */
 
-    p2m_class_t       p2m_class; /* host/nested/? */
+    p2m_class_t       p2m_class; /* host/nested/alternate */
 
     /* Nested p2ms only: nested p2m base value that this p2m shadows.
      * This can be cleared to P2M_BASE_EADDR under the per-p2m lock but
@@ -219,6 +220,9 @@ struct p2m_domain {
      * host p2m's lock. */
     int                defer_nested_flush;
 
+    /* Alternate p2m: count of vcpu's currently using this p2m. */
+    atomic_t           active_vcpus;
+
     /* Pages used to construct the p2m */
     struct page_list_head pages;
 
@@ -317,6 +321,11 @@ static inline bool_t p2m_is_nestedp2m(const struct p2m_domain *p2m)
     return p2m->p2m_class == p2m_nested;
 }
 
+static inline bool_t p2m_is_altp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_alternate;
+}
+
 #define p2m_get_pagetable(p2m)  ((p2m)->phys_table)
 
 /**** p2m query accessors. They lock p2m_lock, and thus serialize
@@ -729,6 +738,29 @@ void nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
     l1_pgentry_t *p, l1_pgentry_t new, unsigned int level);
 
 /*
+ * Alternate p2m: shadow p2m tables used for alternate memory views
+ */
+
+/* get current alternate p2m table */
+static inline struct p2m_domain *p2m_get_altp2m(struct vcpu *v)
+{
+    unsigned int index = vcpu_altp2m(v).p2midx;
+
+    if ( index == INVALID_ALTP2M )
+        return NULL;
+
+    BUG_ON(index >= MAX_ALTP2M);
+
+    return v->domain->arch.altp2m_p2m[index];
+}
+
+/* Locate an alternate p2m by its EPTP */
+unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp);
+
+/* Switch alternate p2m for a single vcpu */
+bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
+
+/*
  * p2m type to IOMMU flags
  */
 static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:42:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAZs-0006Zp-1E; Fri, 31 Jul 2015 13:42: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 1ZLAZq-0006Zi-G7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:22 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	C7/84-03763-D3B7BB55; Fri, 31 Jul 2015 13:42:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350139!29869474!1
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 5623 invoked from network); 31 Jul 2015 13:42:20 -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;
	31 Jul 2015 13:42:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZn-0004Yn-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZn-0007FT-68
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:19 +0000
Date: Fri, 31 Jul 2015 13:42:19 +0000
Message-Id: <E1ZLAZn-0007FT-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: basic data structures and
	support routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d39a32e701cbc4668378caebed0de46f0ed1208c
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:28:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:28:00 2015 +0200

    x86/altp2m: basic data structures and support routines
    
    Add the basic data structures needed to support alternate p2m's and
    the functions to initialise them and tear them down.
    
    Although Intel hardware can handle 512 EPTP's per hardware thread
    concurrently, only 10 per domain are supported in this patch for
    performance reasons.
    
    This change also splits the p2m lock into one lock type for altp2m's
    and another type for all other p2m's. The purpose of this is to place
    the altp2m list lock between the types, so the list lock can be
    acquired whilst holding the host p2m lock.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    
    Cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c         |   21 ++++++++
 xen/arch/x86/mm/Makefile       |    1 +
 xen/arch/x86/mm/altp2m.c       |   77 ++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c      |   40 +++++++++++++++-
 xen/arch/x86/mm/mm-locks.h     |   46 +++++++++++++++++-
 xen/arch/x86/mm/p2m.c          |  101 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/altp2m.h   |   38 +++++++++++++++
 xen/include/asm-x86/domain.h   |   10 ++++
 xen/include/asm-x86/hvm/hvm.h  |   14 ++++++
 xen/include/asm-x86/hvm/vcpu.h |    9 ++++
 xen/include/asm-x86/p2m.h      |   34 +++++++++++++-
 11 files changed, 386 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9de6c66..8c2ace1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -61,6 +61,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/event.h>
 #include <asm/hvm/vmx/vmx.h>
+#include <asm/altp2m.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -2462,6 +2463,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     hvm_all_ioreq_servers_remove_vcpu(v->domain, v);
 
+    altp2m_vcpu_destroy(v);
     nestedhvm_vcpu_destroy(v);
 
     free_compat_arg_xlat(v);
@@ -6567,6 +6569,25 @@ void hvm_toggle_singlestep(struct vcpu *v)
     v->arch.hvm_vcpu.single_step = !v->arch.hvm_vcpu.single_step;
 }
 
+void altp2m_vcpu_update_p2m(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_update_p2m )
+        hvm_funcs.altp2m_vcpu_update_p2m(v);
+}
+
+void altp2m_vcpu_update_vmfunc_ve(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_update_vmfunc_ve )
+        hvm_funcs.altp2m_vcpu_update_vmfunc_ve(v);
+}
+
+bool_t altp2m_vcpu_emulate_ve(struct vcpu *v)
+{
+    if ( hvm_funcs.altp2m_vcpu_emulate_ve )
+        return hvm_funcs.altp2m_vcpu_emulate_ve(v);
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index ed4b1f8..aeccdfc 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -3,6 +3,7 @@ subdir-y += hap
 
 obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
+obj-y += altp2m.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
 obj-$(x86_64) += guest_walk_4.o
diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
new file mode 100644
index 0000000..17b227c
--- /dev/null
+++ b/xen/arch/x86/mm/altp2m.c
@@ -0,0 +1,77 @@
+/*
+ * Alternate p2m HVM
+ * Copyright (c) 2014, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include <asm/hvm/support.h>
+#include <asm/hvm/hvm.h>
+#include <asm/p2m.h>
+#include <asm/altp2m.h>
+
+void
+altp2m_vcpu_reset(struct vcpu *v)
+{
+    struct altp2mvcpu *av = &vcpu_altp2m(v);
+
+    av->p2midx = INVALID_ALTP2M;
+    av->veinfo_gfn = _gfn(INVALID_GFN);
+}
+
+void
+altp2m_vcpu_initialise(struct vcpu *v)
+{
+    if ( v != current )
+        vcpu_pause(v);
+
+    altp2m_vcpu_reset(v);
+    vcpu_altp2m(v).p2midx = 0;
+    atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+
+    altp2m_vcpu_update_p2m(v);
+
+    if ( v != current )
+        vcpu_unpause(v);
+}
+
+void
+altp2m_vcpu_destroy(struct vcpu *v)
+{
+    struct p2m_domain *p2m;
+
+    if ( v != current )
+        vcpu_pause(v);
+
+    if ( (p2m = p2m_get_altp2m(v)) )
+        atomic_dec(&p2m->active_vcpus);
+
+    altp2m_vcpu_reset(v);
+
+    altp2m_vcpu_update_p2m(v);
+    altp2m_vcpu_update_vmfunc_ve(v);
+
+    if ( v != current )
+        vcpu_unpause(v);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 63980af..2d5f6b3 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -459,7 +459,7 @@ void hap_domain_init(struct domain *d)
 int hap_enable(struct domain *d, u32 mode)
 {
     unsigned int old_pages;
-    uint8_t i;
+    unsigned int i;
     int rv = 0;
 
     domain_pause(d);
@@ -498,6 +498,28 @@ int hap_enable(struct domain *d, u32 mode)
            goto out;
     }
 
+    if ( hvm_altp2m_supported() )
+    {
+        /* Init alternate p2m data */
+        if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL )
+        {
+            rv = -ENOMEM;
+            goto out;
+        }
+
+        for ( i = 0; i < MAX_EPTP; i++ )
+            d->arch.altp2m_eptp[i] = INVALID_MFN;
+
+        for ( i = 0; i < MAX_ALTP2M; i++ )
+        {
+            rv = p2m_alloc_table(d->arch.altp2m_p2m[i]);
+            if ( rv != 0 )
+               goto out;
+        }
+
+        d->arch.altp2m_active = 0;
+    }
+
     /* Now let other users see the new mode */
     d->arch.paging.mode = mode | PG_HAP_enable;
 
@@ -508,7 +530,21 @@ int hap_enable(struct domain *d, u32 mode)
 
 void hap_final_teardown(struct domain *d)
 {
-    uint8_t i;
+    unsigned int i;
+
+    if ( hvm_altp2m_supported() )
+    {
+        d->arch.altp2m_active = 0;
+
+        if ( d->arch.altp2m_eptp )
+        {
+            free_xenheap_page(d->arch.altp2m_eptp);
+            d->arch.altp2m_eptp = NULL;
+        }
+
+        for ( i = 0; i < MAX_ALTP2M; i++ )
+            p2m_teardown(d->arch.altp2m_p2m[i]);
+    }
 
     /* Destroy nestedp2m's first */
     for (i = 0; i < MAX_NESTEDP2M; i++) {
diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index b4f035e..c66f105 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -217,7 +217,7 @@ declare_mm_lock(nestedp2m)
 #define nestedp2m_lock(d)   mm_lock(nestedp2m, &(d)->arch.nested_p2m_lock)
 #define nestedp2m_unlock(d) mm_unlock(&(d)->arch.nested_p2m_lock)
 
-/* P2M lock (per-p2m-table)
+/* P2M lock (per-non-alt-p2m-table)
  *
  * This protects all queries and updates to the p2m table.
  * Queries may be made under the read lock but all modifications
@@ -225,10 +225,52 @@ declare_mm_lock(nestedp2m)
  *
  * The write lock is recursive as it is common for a code path to look
  * up a gfn and later mutate it.
+ *
+ * Note that this lock shares its implementation with the altp2m
+ * lock (not the altp2m list lock), so the implementation
+ * is found there.
+ *
+ * Changes made to the host p2m when in altp2m mode are propagated to the
+ * altp2ms synchronously in ept_set_entry().  At that point, we will hold
+ * the host p2m lock; propagating this change involves grabbing the
+ * altp2m_list lock, and the locks of the individual alternate p2ms.  In
+ * order to allow us to maintain locking order discipline, we split the p2m
+ * lock into p2m (for host p2ms) and altp2m (for alternate p2ms), putting
+ * the altp2mlist lock in the middle.
  */
 
 declare_mm_rwlock(p2m);
-#define p2m_lock(p)           mm_write_lock(p2m, &(p)->lock);
+
+/* Alternate P2M list lock (per-domain)
+ *
+ * A per-domain lock that protects the list of alternate p2m's.
+ * Any operation that walks the list needs to acquire this lock.
+ * Additionally, before destroying an alternate p2m all VCPU's
+ * in the target domain must be paused.
+ */
+
+declare_mm_lock(altp2mlist)
+#define altp2m_list_lock(d)   mm_lock(altp2mlist, &(d)->arch.altp2m_list_lock)
+#define altp2m_list_unlock(d) mm_unlock(&(d)->arch.altp2m_list_lock)
+
+/* P2M lock (per-altp2m-table)
+ *
+ * This protects all queries and updates to the p2m table.
+ * Queries may be made under the read lock but all modifications
+ * need the main (write) lock.
+ *
+ * The write lock is recursive as it is common for a code path to look
+ * up a gfn and later mutate it.
+ */
+
+declare_mm_rwlock(altp2m);
+#define p2m_lock(p)                         \
+{                                           \
+    if ( p2m_is_altp2m(p) )                 \
+        mm_write_lock(altp2m, &(p)->lock);  \
+    else                                    \
+        mm_write_lock(p2m, &(p)->lock);     \
+}
 #define p2m_unlock(p)         mm_write_unlock(&(p)->lock);
 #define gfn_lock(p,g,o)       p2m_lock(p)
 #define gfn_unlock(p,g,o)     p2m_unlock(p)
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 89616b7..e4a3f4a 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -35,6 +35,7 @@
 #include <asm/hvm/vmx/vmx.h> /* ept_p2m_init() */
 #include <asm/mem_sharing.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/altp2m.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
 #include <xsm/xsm.h>
 
@@ -183,6 +184,43 @@ static void p2m_teardown_nestedp2m(struct domain *d)
     }
 }
 
+static void p2m_teardown_altp2m(struct domain *d)
+{
+    unsigned int i;
+    struct p2m_domain *p2m;
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( !d->arch.altp2m_p2m[i] )
+            continue;
+        p2m = d->arch.altp2m_p2m[i];
+        d->arch.altp2m_p2m[i] = NULL;
+        p2m_free_one(p2m);
+    }
+}
+
+static int p2m_init_altp2m(struct domain *d)
+{
+    unsigned int i;
+    struct p2m_domain *p2m;
+
+    mm_lock_init(&d->arch.altp2m_list_lock);
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        d->arch.altp2m_p2m[i] = p2m = p2m_init_one(d);
+        if ( p2m == NULL )
+        {
+            p2m_teardown_altp2m(d);
+            return -ENOMEM;
+        }
+        p2m->p2m_class = p2m_alternate;
+        p2m->access_required = 1;
+        _atomic_set(&p2m->active_vcpus, 0);
+    }
+
+    return 0;
+}
+
 int p2m_init(struct domain *d)
 {
     int rc;
@@ -196,7 +234,17 @@ int p2m_init(struct domain *d)
      * (p2m_init runs too early for HVM_PARAM_* options) */
     rc = p2m_init_nestedp2m(d);
     if ( rc )
+    {
+        p2m_teardown_hostp2m(d);
+        return rc;
+    }
+
+    rc = p2m_init_altp2m(d);
+    if ( rc )
+    {
         p2m_teardown_hostp2m(d);
+        p2m_teardown_nestedp2m(d);
+    }
 
     return rc;
 }
@@ -1979,6 +2027,59 @@ int unmap_mmio_regions(struct domain *d,
     return err;
 }
 
+unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp)
+{
+    struct p2m_domain *p2m;
+    struct ept_data *ept;
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] == INVALID_MFN )
+            continue;
+
+        p2m = d->arch.altp2m_p2m[i];
+        ept = &p2m->ept;
+
+        if ( eptp == ept_get_eptp(ept) )
+            goto out;
+    }
+
+    i = INVALID_ALTP2M;
+
+ out:
+    altp2m_list_unlock(d);
+    return i;
+}
+
+bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
+{
+    struct domain *d = v->domain;
+    bool_t rc = 0;
+
+    if ( idx > MAX_ALTP2M )
+        return rc;
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        if ( idx != vcpu_altp2m(v).p2midx )
+        {
+            atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+            vcpu_altp2m(v).p2midx = idx;
+            atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+            altp2m_vcpu_update_p2m(v);
+        }
+        rc = 1;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
 /*** Audit ***/
 
 #if P2M_AUDIT
diff --git a/xen/include/asm-x86/altp2m.h b/xen/include/asm-x86/altp2m.h
new file mode 100644
index 0000000..9e1739d
--- /dev/null
+++ b/xen/include/asm-x86/altp2m.h
@@ -0,0 +1,38 @@
+/*
+ * Alternate p2m HVM
+ * Copyright (c) 2014, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _X86_ALTP2M_H
+#define _X86_ALTP2M_H
+
+#include <xen/types.h>
+#include <xen/sched.h>         /* for struct vcpu, struct domain */
+#include <asm/hvm/vcpu.h>      /* for vcpu_altp2m */
+
+/* Alternate p2m HVM on/off per domain */
+static inline bool_t altp2m_active(const struct domain *d)
+{
+    return d->arch.altp2m_active;
+}
+
+/* Alternate p2m VCPU */
+void altp2m_vcpu_initialise(struct vcpu *v);
+void altp2m_vcpu_destroy(struct vcpu *v);
+void altp2m_vcpu_reset(struct vcpu *v);
+
+#endif /* _X86_ALTP2M_H */
+
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 7a9e96f..0fce09e 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -233,6 +233,10 @@ struct paging_vcpu {
 typedef xen_domctl_cpuid_t cpuid_input_t;
 
 #define MAX_NESTEDP2M 10
+
+#define MAX_ALTP2M      10 /* arbitrary */
+#define INVALID_ALTP2M  0xffff
+#define MAX_EPTP        (PAGE_SIZE / sizeof(uint64_t))
 struct p2m_domain;
 struct time_scale {
     int shift;
@@ -307,6 +311,12 @@ struct arch_domain
     struct p2m_domain *nested_p2m[MAX_NESTEDP2M];
     mm_lock_t nested_p2m_lock;
 
+    /* altp2m: allow multiple copies of host p2m */
+    bool_t altp2m_active;
+    struct p2m_domain *altp2m_p2m[MAX_ALTP2M];
+    mm_lock_t altp2m_list_lock;
+    uint64_t *altp2m_eptp;
+
     /* NB. protected by d->event_lock and by irq_desc[irq].lock */
     struct radix_tree_root irq_pirq;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 3a94f8c..0de061a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -206,6 +206,11 @@ struct hvm_function_table {
 
     void (*enable_msr_exit_interception)(struct domain *d);
     bool_t (*is_singlestep_supported)(void);
+
+    /* Alternate p2m */
+    void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
+    void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
+    bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -546,6 +551,15 @@ extern bool_t opt_hvm_fep;
 #define opt_hvm_fep 0
 #endif
 
+/* updates the current hardware p2m */
+void altp2m_vcpu_update_p2m(struct vcpu *v);
+
+/* updates VMCS fields related to VMFUNC and #VE */
+void altp2m_vcpu_update_vmfunc_ve(struct vcpu *v);
+
+/* emulates #VE */
+bool_t altp2m_vcpu_emulate_ve(struct vcpu *v);
+
 #endif /* __ASM_X86_HVM_HVM_H__ */
 
 /*
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 0df4524..c033c8c 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -135,6 +135,13 @@ struct nestedvcpu {
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
 
+struct altp2mvcpu {
+    uint16_t    p2midx;         /* alternate p2m index */
+    gfn_t       veinfo_gfn;     /* #VE information page gfn */
+};
+
+#define vcpu_altp2m(v) ((v)->arch.hvm_vcpu.avcpu)
+
 struct hvm_vcpu {
     /* Guest control-register and EFER values, just as the guest sees them. */
     unsigned long       guest_cr[5];
@@ -177,6 +184,8 @@ struct hvm_vcpu {
 
     struct nestedvcpu   nvcpu;
 
+    struct altp2mvcpu   avcpu;
+
     struct mtrr_state   mtrr;
     u64                 pat_cr;
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 68da0a9..b6539c8 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -175,6 +175,7 @@ typedef unsigned int p2m_query_t;
 typedef enum {
     p2m_host,
     p2m_nested,
+    p2m_alternate,
 } p2m_class_t;
 
 /* Per-p2m-table state */
@@ -193,7 +194,7 @@ struct p2m_domain {
 
     struct domain     *domain;   /* back pointer to domain */
 
-    p2m_class_t       p2m_class; /* host/nested/? */
+    p2m_class_t       p2m_class; /* host/nested/alternate */
 
     /* Nested p2ms only: nested p2m base value that this p2m shadows.
      * This can be cleared to P2M_BASE_EADDR under the per-p2m lock but
@@ -219,6 +220,9 @@ struct p2m_domain {
      * host p2m's lock. */
     int                defer_nested_flush;
 
+    /* Alternate p2m: count of vcpu's currently using this p2m. */
+    atomic_t           active_vcpus;
+
     /* Pages used to construct the p2m */
     struct page_list_head pages;
 
@@ -317,6 +321,11 @@ static inline bool_t p2m_is_nestedp2m(const struct p2m_domain *p2m)
     return p2m->p2m_class == p2m_nested;
 }
 
+static inline bool_t p2m_is_altp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_alternate;
+}
+
 #define p2m_get_pagetable(p2m)  ((p2m)->phys_table)
 
 /**** p2m query accessors. They lock p2m_lock, and thus serialize
@@ -729,6 +738,29 @@ void nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
     l1_pgentry_t *p, l1_pgentry_t new, unsigned int level);
 
 /*
+ * Alternate p2m: shadow p2m tables used for alternate memory views
+ */
+
+/* get current alternate p2m table */
+static inline struct p2m_domain *p2m_get_altp2m(struct vcpu *v)
+{
+    unsigned int index = vcpu_altp2m(v).p2midx;
+
+    if ( index == INVALID_ALTP2M )
+        return NULL;
+
+    BUG_ON(index >= MAX_ALTP2M);
+
+    return v->domain->arch.altp2m_p2m[index];
+}
+
+/* Locate an alternate p2m by its EPTP */
+unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp);
+
+/* Switch alternate p2m for a single vcpu */
+bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
+
+/*
  * p2m type to IOMMU flags
  */
 static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:42:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAa1-0006bH-DU; Fri, 31 Jul 2015 13:42: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 1ZLAa0-0006b2-3U
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:32 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	D8/C4-25435-74B7BB55; Fri, 31 Jul 2015 13:42:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438350149!36931159!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 24561 invoked from network); 31 Jul 2015 13:42:30 -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;
	31 Jul 2015 13:42:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZx-0004Ys-Gm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZx-0007Gf-FH
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:29 +0000
Date: Fri, 31 Jul 2015 13:42:29 +0000
Message-Id: <E1ZLAZx-0007Gf-FH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX/altp2m: add code to support EPTP
	switching and #VE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a33a7b59f660a44bc0729f0f7396c1240126078
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:29:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:29:18 2015 +0200

    VMX/altp2m: add code to support EPTP switching and #VE
    
    Implement and hook up the code to enable VMX support of VMFUNC and #VE.
    
    VMFUNC leaf 0 (EPTP switching) emulation is added in a later patch.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |  139 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4f8b0e0..945746a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -56,6 +56,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/altp2m.h>
 #include <asm/event.h>
 #include <asm/monitor.h>
 #include <public/arch-x86/cpuid.h>
@@ -1770,6 +1771,105 @@ static bool_t vmx_is_singlestep_supported(void)
     return cpu_has_monitor_trap_flag;
 }
 
+static void vmx_vcpu_update_eptp(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    struct p2m_domain *p2m = NULL;
+    struct ept_data *ept;
+
+    if ( altp2m_active(d) )
+        p2m = p2m_get_altp2m(v);
+    if ( !p2m )
+        p2m = p2m_get_hostp2m(d);
+
+    ept = &p2m->ept;
+    ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m));
+
+    vmx_vmcs_enter(v);
+
+    __vmwrite(EPT_POINTER, ept_get_eptp(ept));
+
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS )
+        __vmwrite(EPTP_INDEX, vcpu_altp2m(v).p2midx);
+
+    vmx_vmcs_exit(v);
+}
+
+static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    u32 mask = SECONDARY_EXEC_ENABLE_VM_FUNCTIONS;
+
+    if ( !cpu_has_vmx_vmfunc )
+        return;
+
+    if ( cpu_has_vmx_virt_exceptions )
+        mask |= SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+
+    vmx_vmcs_enter(v);
+
+    if ( !d->is_dying && altp2m_active(d) )
+    {
+        v->arch.hvm_vmx.secondary_exec_control |= mask;
+        __vmwrite(VM_FUNCTION_CONTROL, VMX_VMFUNC_EPTP_SWITCHING);
+        __vmwrite(EPTP_LIST_ADDR, virt_to_maddr(d->arch.altp2m_eptp));
+
+        if ( cpu_has_vmx_virt_exceptions )
+        {
+            p2m_type_t t;
+            mfn_t mfn;
+
+            mfn = get_gfn_query_unlocked(d, gfn_x(vcpu_altp2m(v).veinfo_gfn), &t);
+
+            if ( mfn_x(mfn) != INVALID_MFN )
+                __vmwrite(VIRT_EXCEPTION_INFO, mfn_x(mfn) << PAGE_SHIFT);
+            else
+                v->arch.hvm_vmx.secondary_exec_control &=
+                    ~SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+        }
+    }
+    else
+        v->arch.hvm_vmx.secondary_exec_control &= ~mask;
+
+    __vmwrite(SECONDARY_VM_EXEC_CONTROL,
+              v->arch.hvm_vmx.secondary_exec_control);
+
+    vmx_vmcs_exit(v);
+}
+
+static bool_t vmx_vcpu_emulate_ve(struct vcpu *v)
+{
+    bool_t rc = 0;
+    ve_info_t *veinfo = gfn_x(vcpu_altp2m(v).veinfo_gfn) != INVALID_GFN ?
+        hvm_map_guest_frame_rw(gfn_x(vcpu_altp2m(v).veinfo_gfn), 0) : NULL;
+
+    if ( !veinfo )
+        return 0;
+
+    if ( veinfo->semaphore != 0 )
+        goto out;
+
+    rc = 1;
+
+    veinfo->exit_reason = EXIT_REASON_EPT_VIOLATION;
+    veinfo->semaphore = ~0;
+    veinfo->eptp_index = vcpu_altp2m(v).p2midx;
+
+    vmx_vmcs_enter(v);
+    __vmread(EXIT_QUALIFICATION, &veinfo->exit_qualification);
+    __vmread(GUEST_LINEAR_ADDRESS, &veinfo->gla);
+    __vmread(GUEST_PHYSICAL_ADDRESS, &veinfo->gpa);
+    vmx_vmcs_exit(v);
+
+    hvm_inject_hw_exception(TRAP_virtualisation,
+                            HVM_DELIVER_NO_ERROR_CODE);
+
+ out:
+    hvm_unmap_guest_frame(veinfo, 0);
+    return rc;
+}
+
 static struct hvm_function_table __initdata vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1828,6 +1928,9 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .hypervisor_cpuid_leaf = vmx_hypervisor_cpuid_leaf,
     .enable_msr_exit_interception = vmx_enable_msr_exit_interception,
     .is_singlestep_supported = vmx_is_singlestep_supported,
+    .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
+    .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
+    .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
 };
 
 const struct hvm_function_table * __init start_vmx(void)
@@ -2769,6 +2872,42 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
     /* Now enable interrupts so it's safe to take locks. */
     local_irq_enable();
 
+    /*
+     * If the guest has the ability to switch EPTP without an exit,
+     * figure out whether it has done so and update the altp2m data.
+     */
+    if ( altp2m_active(v->domain) &&
+        (v->arch.hvm_vmx.secondary_exec_control &
+        SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
+    {
+        unsigned long idx;
+
+        if ( v->arch.hvm_vmx.secondary_exec_control &
+            SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS )
+            __vmread(EPTP_INDEX, &idx);
+        else
+        {
+            unsigned long eptp;
+
+            __vmread(EPT_POINTER, &eptp);
+
+            if ( (idx = p2m_find_altp2m_by_eptp(v->domain, eptp)) ==
+                 INVALID_ALTP2M )
+            {
+                gdprintk(XENLOG_ERR, "EPTP not found in alternate p2m list\n");
+                domain_crash(v->domain);
+            }
+        }
+
+        if ( idx != vcpu_altp2m(v).p2midx )
+        {
+            BUG_ON(idx >= MAX_ALTP2M);
+            atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+            vcpu_altp2m(v).p2midx = idx;
+            atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+        }
+    }
+
     /* XXX: This looks ugly, but we need a mechanism to ensure
      * any pending vmresume has really happened
      */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAa1-0006bH-DU; Fri, 31 Jul 2015 13:42: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 1ZLAa0-0006b2-3U
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:32 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	D8/C4-25435-74B7BB55; Fri, 31 Jul 2015 13:42:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438350149!36931159!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 24561 invoked from network); 31 Jul 2015 13:42:30 -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;
	31 Jul 2015 13:42:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZx-0004Ys-Gm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAZx-0007Gf-FH
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:29 +0000
Date: Fri, 31 Jul 2015 13:42:29 +0000
Message-Id: <E1ZLAZx-0007Gf-FH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX/altp2m: add code to support EPTP
	switching and #VE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a33a7b59f660a44bc0729f0f7396c1240126078
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:29:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:29:18 2015 +0200

    VMX/altp2m: add code to support EPTP switching and #VE
    
    Implement and hook up the code to enable VMX support of VMFUNC and #VE.
    
    VMFUNC leaf 0 (EPTP switching) emulation is added in a later patch.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |  139 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4f8b0e0..945746a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -56,6 +56,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/altp2m.h>
 #include <asm/event.h>
 #include <asm/monitor.h>
 #include <public/arch-x86/cpuid.h>
@@ -1770,6 +1771,105 @@ static bool_t vmx_is_singlestep_supported(void)
     return cpu_has_monitor_trap_flag;
 }
 
+static void vmx_vcpu_update_eptp(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    struct p2m_domain *p2m = NULL;
+    struct ept_data *ept;
+
+    if ( altp2m_active(d) )
+        p2m = p2m_get_altp2m(v);
+    if ( !p2m )
+        p2m = p2m_get_hostp2m(d);
+
+    ept = &p2m->ept;
+    ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m));
+
+    vmx_vmcs_enter(v);
+
+    __vmwrite(EPT_POINTER, ept_get_eptp(ept));
+
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS )
+        __vmwrite(EPTP_INDEX, vcpu_altp2m(v).p2midx);
+
+    vmx_vmcs_exit(v);
+}
+
+static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    u32 mask = SECONDARY_EXEC_ENABLE_VM_FUNCTIONS;
+
+    if ( !cpu_has_vmx_vmfunc )
+        return;
+
+    if ( cpu_has_vmx_virt_exceptions )
+        mask |= SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+
+    vmx_vmcs_enter(v);
+
+    if ( !d->is_dying && altp2m_active(d) )
+    {
+        v->arch.hvm_vmx.secondary_exec_control |= mask;
+        __vmwrite(VM_FUNCTION_CONTROL, VMX_VMFUNC_EPTP_SWITCHING);
+        __vmwrite(EPTP_LIST_ADDR, virt_to_maddr(d->arch.altp2m_eptp));
+
+        if ( cpu_has_vmx_virt_exceptions )
+        {
+            p2m_type_t t;
+            mfn_t mfn;
+
+            mfn = get_gfn_query_unlocked(d, gfn_x(vcpu_altp2m(v).veinfo_gfn), &t);
+
+            if ( mfn_x(mfn) != INVALID_MFN )
+                __vmwrite(VIRT_EXCEPTION_INFO, mfn_x(mfn) << PAGE_SHIFT);
+            else
+                v->arch.hvm_vmx.secondary_exec_control &=
+                    ~SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS;
+        }
+    }
+    else
+        v->arch.hvm_vmx.secondary_exec_control &= ~mask;
+
+    __vmwrite(SECONDARY_VM_EXEC_CONTROL,
+              v->arch.hvm_vmx.secondary_exec_control);
+
+    vmx_vmcs_exit(v);
+}
+
+static bool_t vmx_vcpu_emulate_ve(struct vcpu *v)
+{
+    bool_t rc = 0;
+    ve_info_t *veinfo = gfn_x(vcpu_altp2m(v).veinfo_gfn) != INVALID_GFN ?
+        hvm_map_guest_frame_rw(gfn_x(vcpu_altp2m(v).veinfo_gfn), 0) : NULL;
+
+    if ( !veinfo )
+        return 0;
+
+    if ( veinfo->semaphore != 0 )
+        goto out;
+
+    rc = 1;
+
+    veinfo->exit_reason = EXIT_REASON_EPT_VIOLATION;
+    veinfo->semaphore = ~0;
+    veinfo->eptp_index = vcpu_altp2m(v).p2midx;
+
+    vmx_vmcs_enter(v);
+    __vmread(EXIT_QUALIFICATION, &veinfo->exit_qualification);
+    __vmread(GUEST_LINEAR_ADDRESS, &veinfo->gla);
+    __vmread(GUEST_PHYSICAL_ADDRESS, &veinfo->gpa);
+    vmx_vmcs_exit(v);
+
+    hvm_inject_hw_exception(TRAP_virtualisation,
+                            HVM_DELIVER_NO_ERROR_CODE);
+
+ out:
+    hvm_unmap_guest_frame(veinfo, 0);
+    return rc;
+}
+
 static struct hvm_function_table __initdata vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1828,6 +1928,9 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .hypervisor_cpuid_leaf = vmx_hypervisor_cpuid_leaf,
     .enable_msr_exit_interception = vmx_enable_msr_exit_interception,
     .is_singlestep_supported = vmx_is_singlestep_supported,
+    .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
+    .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
+    .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
 };
 
 const struct hvm_function_table * __init start_vmx(void)
@@ -2769,6 +2872,42 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
     /* Now enable interrupts so it's safe to take locks. */
     local_irq_enable();
 
+    /*
+     * If the guest has the ability to switch EPTP without an exit,
+     * figure out whether it has done so and update the altp2m data.
+     */
+    if ( altp2m_active(v->domain) &&
+        (v->arch.hvm_vmx.secondary_exec_control &
+        SECONDARY_EXEC_ENABLE_VM_FUNCTIONS) )
+    {
+        unsigned long idx;
+
+        if ( v->arch.hvm_vmx.secondary_exec_control &
+            SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS )
+            __vmread(EPTP_INDEX, &idx);
+        else
+        {
+            unsigned long eptp;
+
+            __vmread(EPT_POINTER, &eptp);
+
+            if ( (idx = p2m_find_altp2m_by_eptp(v->domain, eptp)) ==
+                 INVALID_ALTP2M )
+            {
+                gdprintk(XENLOG_ERR, "EPTP not found in alternate p2m list\n");
+                domain_crash(v->domain);
+            }
+        }
+
+        if ( idx != vcpu_altp2m(v).p2midx )
+        {
+            BUG_ON(idx >= MAX_ALTP2M);
+            atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+            vcpu_altp2m(v).p2midx = idx;
+            atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+        }
+    }
+
     /* XXX: This looks ugly, but we need a mechanism to ensure
      * any pending vmresume has really happened
      */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAaB-0006cQ-G4; Fri, 31 Jul 2015 13:42: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 1ZLAaA-0006cF-5x
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:42 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D5/C8-10422-15B7BB55; Fri, 31 Jul 2015 13:42:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438350159!24967045!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 8585 invoked from network); 31 Jul 2015 13:42:40 -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;
	31 Jul 2015 13:42:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAa7-0004Z8-MJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAa7-0007HI-LN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:39 +0000
Date: Fri, 31 Jul 2015 13:42:39 +0000
Message-Id: <E1ZLAa7-0007HI-LN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: add VMFUNC leaf 0 (EPTP
	switching) to emulator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1b1572833f3d4a6d29bce750763fcf48c016a0a
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Fri Jul 24 13:29:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:29:56 2015 +0200

    VMX: add VMFUNC leaf 0 (EPTP switching) to emulator
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/emulate.c             |   18 ++++++++++++++-
 xen/arch/x86/hvm/vmx/vmx.c             |   36 ++++++++++++++++++++++++++++++++
 xen/arch/x86/x86_emulate/x86_emulate.c |   19 +++++++++++-----
 xen/arch/x86/x86_emulate/x86_emulate.h |    4 +++
 xen/include/asm-x86/hvm/hvm.h          |    2 +
 5 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 15c2496..30acb78 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1593,6 +1593,18 @@ static int hvmemul_invlpg(
     return rc;
 }
 
+static int hvmemul_vmfunc(
+    struct x86_emulate_ctxt *ctxt)
+{
+    int rc;
+
+    rc = hvm_funcs.altp2m_vcpu_emulate_vmfunc(ctxt->regs);
+    if ( rc != X86EMUL_OKAY )
+        hvmemul_inject_hw_exception(TRAP_invalid_op, 0, ctxt);
+
+    return rc;
+}
+
 static const struct x86_emulate_ops hvm_emulate_ops = {
     .read          = hvmemul_read,
     .insn_fetch    = hvmemul_insn_fetch,
@@ -1616,7 +1628,8 @@ static const struct x86_emulate_ops hvm_emulate_ops = {
     .inject_sw_interrupt = hvmemul_inject_sw_interrupt,
     .get_fpu       = hvmemul_get_fpu,
     .put_fpu       = hvmemul_put_fpu,
-    .invlpg        = hvmemul_invlpg
+    .invlpg        = hvmemul_invlpg,
+    .vmfunc        = hvmemul_vmfunc,
 };
 
 static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
@@ -1642,7 +1655,8 @@ static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
     .inject_sw_interrupt = hvmemul_inject_sw_interrupt,
     .get_fpu       = hvmemul_get_fpu,
     .put_fpu       = hvmemul_put_fpu,
-    .invlpg        = hvmemul_invlpg
+    .invlpg        = hvmemul_invlpg,
+    .vmfunc        = hvmemul_vmfunc,
 };
 
 static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 945746a..6e69ac0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -82,6 +82,7 @@ static void vmx_fpu_dirty_intercept(void);
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
 static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
 static void vmx_invlpg_intercept(unsigned long vaddr);
+static int vmx_vmfunc_intercept(struct cpu_user_regs *regs);
 
 uint8_t __read_mostly posted_intr_vector;
 
@@ -1838,6 +1839,19 @@ static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
+static int vmx_vcpu_emulate_vmfunc(struct cpu_user_regs *regs)
+{
+    int rc = X86EMUL_EXCEPTION;
+    struct vcpu *curr = current;
+
+    if ( !cpu_has_vmx_vmfunc && altp2m_active(curr->domain) &&
+         regs->_eax == 0 &&
+         p2m_switch_vcpu_altp2m_by_id(curr, regs->_ecx) )
+        rc = X86EMUL_OKAY;
+
+    return rc;
+}
+
 static bool_t vmx_vcpu_emulate_ve(struct vcpu *v)
 {
     bool_t rc = 0;
@@ -1906,6 +1920,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .vmfunc_intercept     = vmx_vmfunc_intercept,
     .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
@@ -1931,6 +1946,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
     .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
     .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
+    .altp2m_vcpu_emulate_vmfunc = vmx_vcpu_emulate_vmfunc,
 };
 
 const struct hvm_function_table * __init start_vmx(void)
@@ -2102,6 +2118,19 @@ static void vmx_invlpg_intercept(unsigned long vaddr)
         vpid_sync_vcpu_gva(curr, vaddr);
 }
 
+static int vmx_vmfunc_intercept(struct cpu_user_regs *regs)
+{
+    /*
+     * This handler is a placeholder for future where Xen may
+     * want to handle VMFUNC exits and resume a domain normally without
+     * injecting a #UD to the guest - for example, in a VT-nested
+     * scenario where Xen may want to lazily shadow the alternate
+     * EPTP list.
+     */
+    gdprintk(XENLOG_ERR, "Failed guest VMFUNC execution\n");
+    return X86EMUL_EXCEPTION;
+}
+
 static int vmx_cr_access(unsigned long exit_qualification)
 {
     struct vcpu *curr = current;
@@ -3260,6 +3289,13 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             update_guest_eip();
         break;
 
+    case EXIT_REASON_VMFUNC:
+        if ( vmx_vmfunc_intercept(regs) != X86EMUL_OKAY )
+            hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            update_guest_eip();
+        break;
+
     case EXIT_REASON_MWAIT_INSTRUCTION:
     case EXIT_REASON_MONITOR_INSTRUCTION:
     case EXIT_REASON_GETSEC:
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index c017c69..e596131 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3786,6 +3786,7 @@ x86_emulate(
         break;
     }
 
+ no_writeback:
     /* Inject #DB if single-step tracing was enabled at instruction start. */
     if ( (ctxt->regs->eflags & EFLG_TF) && (rc == X86EMUL_OKAY) &&
          (ops->inject_hw_exception != NULL) )
@@ -3816,19 +3817,17 @@ x86_emulate(
         struct segment_register reg;
         unsigned long base, limit, cr0, cr0w;
 
-        if ( modrm == 0xdf ) /* invlpga */
+        switch( modrm )
         {
+        case 0xdf: /* invlpga */
             generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
             generate_exception_if(!mode_ring0(), EXC_GP, 0);
             fail_if(ops->invlpg == NULL);
             if ( (rc = ops->invlpg(x86_seg_none, truncate_ea(_regs.eax),
                                    ctxt)) )
                 goto done;
-            break;
-        }
-
-        if ( modrm == 0xf9 ) /* rdtscp */
-        {
+            goto no_writeback;
+        case 0xf9: /* rdtscp */ {
             uint64_t tsc_aux;
             fail_if(ops->read_msr == NULL);
             if ( (rc = ops->read_msr(MSR_TSC_AUX, &tsc_aux, ctxt)) != 0 )
@@ -3836,6 +3835,14 @@ x86_emulate(
             _regs.ecx = (uint32_t)tsc_aux;
             goto rdtsc;
         }
+        case 0xd4: /* vmfunc */
+            generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx == vex_66),
+                                  EXC_UD, -1);
+            fail_if(ops->vmfunc == NULL);
+            if ( (rc = ops->vmfunc(ctxt) != X86EMUL_OKAY) )
+                goto done;
+            goto no_writeback;
+        }
 
         switch ( modrm_reg & 7 )
         {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 064b8f4..a4d4ec8 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -397,6 +397,10 @@ struct x86_emulate_ops
         enum x86_segment seg,
         unsigned long offset,
         struct x86_emulate_ctxt *ctxt);
+
+    /* vmfunc: Emulate VMFUNC via given set of EAX ECX inputs */
+    int (*vmfunc)(
+        struct x86_emulate_ctxt *ctxt);
 };
 
 struct cpu_user_regs;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0de061a..425327a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -167,6 +167,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    int (*vmfunc_intercept)(struct cpu_user_regs *regs);
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
@@ -211,6 +212,7 @@ struct hvm_function_table {
     void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
     void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
     bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
+    int (*altp2m_vcpu_emulate_vmfunc)(struct cpu_user_regs *regs);
 };
 
 extern struct hvm_function_table hvm_funcs;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAaB-0006cQ-G4; Fri, 31 Jul 2015 13:42: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 1ZLAaA-0006cF-5x
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:42 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D5/C8-10422-15B7BB55; Fri, 31 Jul 2015 13:42:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438350159!24967045!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 8585 invoked from network); 31 Jul 2015 13:42:40 -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;
	31 Jul 2015 13:42:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAa7-0004Z8-MJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAa7-0007HI-LN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:39 +0000
Date: Fri, 31 Jul 2015 13:42:39 +0000
Message-Id: <E1ZLAa7-0007HI-LN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: add VMFUNC leaf 0 (EPTP
	switching) to emulator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1b1572833f3d4a6d29bce750763fcf48c016a0a
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Fri Jul 24 13:29:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:29:56 2015 +0200

    VMX: add VMFUNC leaf 0 (EPTP switching) to emulator
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/emulate.c             |   18 ++++++++++++++-
 xen/arch/x86/hvm/vmx/vmx.c             |   36 ++++++++++++++++++++++++++++++++
 xen/arch/x86/x86_emulate/x86_emulate.c |   19 +++++++++++-----
 xen/arch/x86/x86_emulate/x86_emulate.h |    4 +++
 xen/include/asm-x86/hvm/hvm.h          |    2 +
 5 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 15c2496..30acb78 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1593,6 +1593,18 @@ static int hvmemul_invlpg(
     return rc;
 }
 
+static int hvmemul_vmfunc(
+    struct x86_emulate_ctxt *ctxt)
+{
+    int rc;
+
+    rc = hvm_funcs.altp2m_vcpu_emulate_vmfunc(ctxt->regs);
+    if ( rc != X86EMUL_OKAY )
+        hvmemul_inject_hw_exception(TRAP_invalid_op, 0, ctxt);
+
+    return rc;
+}
+
 static const struct x86_emulate_ops hvm_emulate_ops = {
     .read          = hvmemul_read,
     .insn_fetch    = hvmemul_insn_fetch,
@@ -1616,7 +1628,8 @@ static const struct x86_emulate_ops hvm_emulate_ops = {
     .inject_sw_interrupt = hvmemul_inject_sw_interrupt,
     .get_fpu       = hvmemul_get_fpu,
     .put_fpu       = hvmemul_put_fpu,
-    .invlpg        = hvmemul_invlpg
+    .invlpg        = hvmemul_invlpg,
+    .vmfunc        = hvmemul_vmfunc,
 };
 
 static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
@@ -1642,7 +1655,8 @@ static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
     .inject_sw_interrupt = hvmemul_inject_sw_interrupt,
     .get_fpu       = hvmemul_get_fpu,
     .put_fpu       = hvmemul_put_fpu,
-    .invlpg        = hvmemul_invlpg
+    .invlpg        = hvmemul_invlpg,
+    .vmfunc        = hvmemul_vmfunc,
 };
 
 static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 945746a..6e69ac0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -82,6 +82,7 @@ static void vmx_fpu_dirty_intercept(void);
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
 static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
 static void vmx_invlpg_intercept(unsigned long vaddr);
+static int vmx_vmfunc_intercept(struct cpu_user_regs *regs);
 
 uint8_t __read_mostly posted_intr_vector;
 
@@ -1838,6 +1839,19 @@ static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
+static int vmx_vcpu_emulate_vmfunc(struct cpu_user_regs *regs)
+{
+    int rc = X86EMUL_EXCEPTION;
+    struct vcpu *curr = current;
+
+    if ( !cpu_has_vmx_vmfunc && altp2m_active(curr->domain) &&
+         regs->_eax == 0 &&
+         p2m_switch_vcpu_altp2m_by_id(curr, regs->_ecx) )
+        rc = X86EMUL_OKAY;
+
+    return rc;
+}
+
 static bool_t vmx_vcpu_emulate_ve(struct vcpu *v)
 {
     bool_t rc = 0;
@@ -1906,6 +1920,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .vmfunc_intercept     = vmx_vmfunc_intercept,
     .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
@@ -1931,6 +1946,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
     .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
     .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
+    .altp2m_vcpu_emulate_vmfunc = vmx_vcpu_emulate_vmfunc,
 };
 
 const struct hvm_function_table * __init start_vmx(void)
@@ -2102,6 +2118,19 @@ static void vmx_invlpg_intercept(unsigned long vaddr)
         vpid_sync_vcpu_gva(curr, vaddr);
 }
 
+static int vmx_vmfunc_intercept(struct cpu_user_regs *regs)
+{
+    /*
+     * This handler is a placeholder for future where Xen may
+     * want to handle VMFUNC exits and resume a domain normally without
+     * injecting a #UD to the guest - for example, in a VT-nested
+     * scenario where Xen may want to lazily shadow the alternate
+     * EPTP list.
+     */
+    gdprintk(XENLOG_ERR, "Failed guest VMFUNC execution\n");
+    return X86EMUL_EXCEPTION;
+}
+
 static int vmx_cr_access(unsigned long exit_qualification)
 {
     struct vcpu *curr = current;
@@ -3260,6 +3289,13 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             update_guest_eip();
         break;
 
+    case EXIT_REASON_VMFUNC:
+        if ( vmx_vmfunc_intercept(regs) != X86EMUL_OKAY )
+            hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            update_guest_eip();
+        break;
+
     case EXIT_REASON_MWAIT_INSTRUCTION:
     case EXIT_REASON_MONITOR_INSTRUCTION:
     case EXIT_REASON_GETSEC:
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index c017c69..e596131 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3786,6 +3786,7 @@ x86_emulate(
         break;
     }
 
+ no_writeback:
     /* Inject #DB if single-step tracing was enabled at instruction start. */
     if ( (ctxt->regs->eflags & EFLG_TF) && (rc == X86EMUL_OKAY) &&
          (ops->inject_hw_exception != NULL) )
@@ -3816,19 +3817,17 @@ x86_emulate(
         struct segment_register reg;
         unsigned long base, limit, cr0, cr0w;
 
-        if ( modrm == 0xdf ) /* invlpga */
+        switch( modrm )
         {
+        case 0xdf: /* invlpga */
             generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
             generate_exception_if(!mode_ring0(), EXC_GP, 0);
             fail_if(ops->invlpg == NULL);
             if ( (rc = ops->invlpg(x86_seg_none, truncate_ea(_regs.eax),
                                    ctxt)) )
                 goto done;
-            break;
-        }
-
-        if ( modrm == 0xf9 ) /* rdtscp */
-        {
+            goto no_writeback;
+        case 0xf9: /* rdtscp */ {
             uint64_t tsc_aux;
             fail_if(ops->read_msr == NULL);
             if ( (rc = ops->read_msr(MSR_TSC_AUX, &tsc_aux, ctxt)) != 0 )
@@ -3836,6 +3835,14 @@ x86_emulate(
             _regs.ecx = (uint32_t)tsc_aux;
             goto rdtsc;
         }
+        case 0xd4: /* vmfunc */
+            generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx == vex_66),
+                                  EXC_UD, -1);
+            fail_if(ops->vmfunc == NULL);
+            if ( (rc = ops->vmfunc(ctxt) != X86EMUL_OKAY) )
+                goto done;
+            goto no_writeback;
+        }
 
         switch ( modrm_reg & 7 )
         {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 064b8f4..a4d4ec8 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -397,6 +397,10 @@ struct x86_emulate_ops
         enum x86_segment seg,
         unsigned long offset,
         struct x86_emulate_ctxt *ctxt);
+
+    /* vmfunc: Emulate VMFUNC via given set of EAX ECX inputs */
+    int (*vmfunc)(
+        struct x86_emulate_ctxt *ctxt);
 };
 
 struct cpu_user_regs;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0de061a..425327a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -167,6 +167,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    int (*vmfunc_intercept)(struct cpu_user_regs *regs);
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
@@ -211,6 +212,7 @@ struct hvm_function_table {
     void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
     void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
     bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
+    int (*altp2m_vcpu_emulate_vmfunc)(struct cpu_user_regs *regs);
 };
 
 extern struct hvm_function_table hvm_funcs;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAaN-0006e6-Il; Fri, 31 Jul 2015 13:42: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 1ZLAaL-0006dm-7k
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:53 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	C5/CC-10715-C5B7BB55; Fri, 31 Jul 2015 13:42:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350170!35429026!1
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 26395 invoked from network); 31 Jul 2015 13:42:50 -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;
	31 Jul 2015 13:42:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaH-0004ZG-Re
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaH-0007Hj-Qb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:49 +0000
Date: Fri, 31 Jul 2015 13:42:49 +0000
Message-Id: <E1ZLAaH-0007Hj-Qb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add control of suppress_ve
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00e5fe6a83421766d5138c0cdf331e2e2b499da5
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri Jul 24 13:30:44 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:32:42 2015 +0200

    x86/altp2m: add control of suppress_ve
    
    The existing ept_set_entry() and ept_get_entry() routines are extended
    to optionally set/get suppress_ve.  Passing -1 will set suppress_ve on
    new p2m entries, or retain suppress_ve flag on existing entries.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    
    Also adjust the caller in set_identity_p2m_entry().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/mem_sharing.c |    4 +-
 xen/arch/x86/mm/p2m-ept.c     |   16 ++++++++++--
 xen/arch/x86/mm/p2m-pod.c     |   12 +++++-----
 xen/arch/x86/mm/p2m-pt.c      |   10 ++++++-
 xen/arch/x86/mm/p2m.c         |   50 ++++++++++++++++++++--------------------
 xen/include/asm-x86/p2m.h     |   24 ++++++++++---------
 6 files changed, 67 insertions(+), 49 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 1a01e45..d2e3786 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1260,7 +1260,7 @@ int relinquish_shared_pages(struct domain *d)
 
         if ( atomic_read(&d->shr_pages) == 0 )
             break;
-        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL);
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             /* Does not fail with ENOMEM given the DESTROY flag */
@@ -1270,7 +1270,7 @@ int relinquish_shared_pages(struct domain *d)
              * unshare.  Must succeed: we just read the old entry and
              * we hold the p2m lock. */
             set_rc = p2m->set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_4K,
-                                    p2m_invalid, p2m_access_rwx);
+                                    p2m_invalid, p2m_access_rwx, -1);
             ASSERT(set_rc == 0);
             count += 0x10;
         }
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index b532811..b4c65f9 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -658,7 +658,8 @@ bool_t ept_handle_misconfig(uint64_t gpa)
  */
 static int
 ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, 
-              unsigned int order, p2m_type_t p2mt, p2m_access_t p2ma)
+              unsigned int order, p2m_type_t p2mt, p2m_access_t p2ma,
+              int sve)
 {
     ept_entry_t *table, *ept_entry = NULL;
     unsigned long gfn_remainder = gfn;
@@ -804,7 +805,11 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
 
-    new_entry.suppress_ve = 1;
+    if ( sve != -1 )
+        new_entry.suppress_ve = !!sve;
+    else
+        new_entry.suppress_ve = is_epte_valid(&old_entry) ?
+                                    old_entry.suppress_ve : 1;
 
     rc = atomic_write_ept_entry(ept_entry, new_entry, target);
     if ( unlikely(rc) )
@@ -852,7 +857,8 @@ out:
 /* Read ept p2m entries */
 static mfn_t ept_get_entry(struct p2m_domain *p2m,
                            unsigned long gfn, p2m_type_t *t, p2m_access_t* a,
-                           p2m_query_t q, unsigned int *page_order)
+                           p2m_query_t q, unsigned int *page_order,
+                           bool_t *sve)
 {
     ept_entry_t *table = map_domain_page(_mfn(pagetable_get_pfn(p2m_get_pagetable(p2m))));
     unsigned long gfn_remainder = gfn;
@@ -866,6 +872,8 @@ static mfn_t ept_get_entry(struct p2m_domain *p2m,
 
     *t = p2m_mmio_dm;
     *a = p2m_access_n;
+    if ( sve )
+        *sve = 1;
 
     /* This pfn is higher than the highest the p2m map currently holds */
     if ( gfn > p2m->max_mapped_pfn )
@@ -931,6 +939,8 @@ static mfn_t ept_get_entry(struct p2m_domain *p2m,
         else
             *t = ept_entry->sa_p2mt;
         *a = ept_entry->access;
+        if ( sve )
+            *sve = ept_entry->suppress_ve;
 
         mfn = _mfn(ept_entry->mfn);
         if ( i )
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 6e27bcd..6aee85a 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -536,7 +536,7 @@ recount:
         p2m_access_t a;
         p2m_type_t t;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
 
         if ( t == p2m_populate_on_demand )
             pod++;
@@ -587,7 +587,7 @@ recount:
         p2m_type_t t;
         p2m_access_t a;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
         if ( t == p2m_populate_on_demand )
         {
             p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
@@ -676,7 +676,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
 
         if ( i == 0 )
         {
@@ -808,7 +808,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
     for ( i=0; i<count; i++ )
     {
         p2m_access_t a;
-        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL);
+        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL, NULL);
         /* If this is ram, and not a pagetable or from the xen heap, and probably not mapped
            elsewhere, map it; otherwise, skip. */
         if ( p2m_is_ram(types[i])
@@ -947,7 +947,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
     for ( i=p2m->pod.reclaim_single; i > 0 ; i-- )
     {
         p2m_access_t a;
-        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL);
+        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL, NULL);
         if ( p2m_is_ram(t) )
         {
             gfns[j] = i;
@@ -1135,7 +1135,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a6dd464..926de0b 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -482,7 +482,8 @@ int p2m_pt_handle_deferred_changes(uint64_t gpa)
 /* Returns: 0 for success, -errno for failure */
 static int
 p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
-                 unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma)
+                 unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma,
+                 int sve)
 {
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
@@ -495,6 +496,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
     unsigned long old_mfn = 0;
 
+    ASSERT(sve != 0);
+
     if ( tb_init_done )
     {
         struct {
@@ -689,7 +692,7 @@ static inline p2m_type_t recalc_type(bool_t recalc, p2m_type_t t,
 static mfn_t
 p2m_pt_get_entry(struct p2m_domain *p2m, unsigned long gfn,
                  p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
-                 unsigned int *page_order)
+                 unsigned int *page_order, bool_t *sve)
 {
     mfn_t mfn;
     paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
@@ -701,6 +704,9 @@ p2m_pt_get_entry(struct p2m_domain *p2m, unsigned long gfn,
 
     ASSERT(paging_mode_translate(p2m->domain));
 
+    if ( sve )
+        *sve = 1;
+
     /* XXX This is for compatibility with the old model, where anything not 
      * XXX marked as RAM was considered to be emulated MMIO space.
      * XXX Once we start explicitly registering MMIO regions in the p2m 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index e4a3f4a..0126dc0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -345,7 +345,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
         /* Grab the lock here, don't release until put_gfn */
         gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
+    mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order, NULL);
 
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
@@ -354,7 +354,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
          * sleeping. */
         if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
             (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
-        mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
+        mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order, NULL);
     }
 
     if (unlikely((p2m_is_broken(*t))))
@@ -458,7 +458,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         else
             order = 0;
 
-        set_rc = p2m->set_entry(p2m, gfn, mfn, order, p2mt, p2ma);
+        set_rc = p2m->set_entry(p2m, gfn, mfn, order, p2mt, p2ma, -1);
         if ( set_rc )
             rc = set_rc;
 
@@ -622,7 +622,7 @@ p2m_remove_page(struct p2m_domain *p2m, unsigned long gfn, unsigned long mfn,
     {
         for ( i = 0; i < (1UL << page_order); i++ )
         {
-            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
+            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL, NULL);
             if ( !p2m_is_grant(t) && !p2m_is_shared(t) && !p2m_is_foreign(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
@@ -687,7 +687,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
     /* First, remove m->p mappings for existing p->m mappings */
     for ( i = 0; i < (1UL << page_order); i++ )
     {
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
         if ( p2m_is_shared(ot) )
         {
             /* Do an unshare to cleanly take care of all corner 
@@ -711,7 +711,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
                 (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
-            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
         if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
@@ -759,7 +759,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
              * address */
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
-            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL);
+            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL, NULL);
             if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
@@ -826,7 +826,7 @@ int p2m_change_type_one(struct domain *d, unsigned long gfn,
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL, NULL);
     rc = likely(pt == ot)
          ? p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt,
                          p2m->default_access)
@@ -910,7 +910,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL, NULL);
     if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
     {
         p2m_unlock(p2m);
@@ -962,7 +962,7 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm )
         ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
@@ -998,7 +998,7 @@ int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    actual_mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
+    actual_mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(actual_mfn)) || (t != p2m_mmio_direct) )
@@ -1034,7 +1034,7 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL, NULL);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
     ASSERT(p2m_is_shared(ot));
@@ -1086,7 +1086,7 @@ int p2m_mem_paging_nominate(struct domain *d, unsigned long gfn)
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     /* Check if mfn is valid */
     if ( !mfn_valid(mfn) )
@@ -1148,7 +1148,7 @@ int p2m_mem_paging_evict(struct domain *d, unsigned long gfn)
     gfn_lock(p2m, gfn, 0);
 
     /* Get mfn */
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
     if ( unlikely(!mfn_valid(mfn)) )
         goto out;
 
@@ -1280,7 +1280,7 @@ void p2m_mem_paging_populate(struct domain *d, unsigned long gfn)
 
     /* Fix p2m mapping */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
     /* Allow only nominated or evicted pages to enter page-in path */
     if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
     {
@@ -1342,7 +1342,7 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     ret = -ENOENT;
     /* Allow missing pages */
@@ -1430,7 +1430,7 @@ void p2m_mem_paging_resume(struct domain *d, vm_event_response_t *rsp)
         unsigned long gfn = rsp->u.mem_access.gfn;
 
         gfn_lock(p2m, gfn, 0);
-        mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
         /*
          * Allow only pages which were prepared properly, or pages which
          * were nominated but not evicted.
@@ -1579,11 +1579,11 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
      * These calls to p2m->set_entry() must succeed: we have the gfn
      * locked and just did a successful get_entry(). */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, NULL);
 
     if ( npfec.write_access && p2ma == p2m_access_rx2rw ) 
     {
-        rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt, p2m_access_rw);
+        rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt, p2m_access_rw, -1);
         ASSERT(rc == 0);
         gfn_unlock(p2m, gfn, 0);
         return 1;
@@ -1592,7 +1592,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     {
         ASSERT(npfec.write_access || npfec.read_access || npfec.insn_fetch);
         rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
-                            p2mt, p2m_access_rwx);
+                            p2mt, p2m_access_rwx, -1);
         ASSERT(rc == 0);
     }
     gfn_unlock(p2m, gfn, 0);
@@ -1612,14 +1612,14 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
         else
         {
             gfn_lock(p2m, gfn, 0);
-            mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+            mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, NULL);
             if ( p2ma != p2m_access_n2rwx )
             {
                 /* A listener is not required, so clear the access
                  * restrictions.  This set must succeed: we have the
                  * gfn locked and just did a successful get_entry(). */
                 rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
-                                    p2mt, p2m_access_rwx);
+                                    p2mt, p2m_access_rwx, -1);
                 ASSERT(rc == 0);
             }
             gfn_unlock(p2m, gfn, 0);
@@ -1750,8 +1750,8 @@ long p2m_set_mem_access(struct domain *d, gfn_t gfn, uint32_t nr,
     p2m_lock(p2m);
     for ( gfn_l = gfn_x(gfn) + start; nr > start; ++gfn_l )
     {
-        mfn = p2m->get_entry(p2m, gfn_l, &t, &_a, 0, NULL);
-        rc = p2m->set_entry(p2m, gfn_l, mfn, PAGE_ORDER_4K, t, a);
+        mfn = p2m->get_entry(p2m, gfn_l, &t, &_a, 0, NULL, NULL);
+        rc = p2m->set_entry(p2m, gfn_l, mfn, PAGE_ORDER_4K, t, a, -1);
         if ( rc )
             break;
 
@@ -1800,7 +1800,7 @@ int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t *access)
     }
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn_x(gfn), &t, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn_x(gfn), &t, &a, 0, NULL, NULL);
     gfn_unlock(p2m, gfn, 0);
 
     if ( mfn_x(mfn) == INVALID_MFN )
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b6539c8..f5188c0 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -226,17 +226,19 @@ struct p2m_domain {
     /* Pages used to construct the p2m */
     struct page_list_head pages;
 
-    int                (*set_entry   )(struct p2m_domain *p2m,
-                                       unsigned long gfn,
-                                       mfn_t mfn, unsigned int page_order,
-                                       p2m_type_t p2mt,
-                                       p2m_access_t p2ma);
-    mfn_t              (*get_entry   )(struct p2m_domain *p2m,
-                                       unsigned long gfn,
-                                       p2m_type_t *p2mt,
-                                       p2m_access_t *p2ma,
-                                       p2m_query_t q,
-                                       unsigned int *page_order);
+    int                (*set_entry)(struct p2m_domain *p2m,
+                                    unsigned long gfn,
+                                    mfn_t mfn, unsigned int page_order,
+                                    p2m_type_t p2mt,
+                                    p2m_access_t p2ma,
+                                    int sve);
+    mfn_t              (*get_entry)(struct p2m_domain *p2m,
+                                    unsigned long gfn,
+                                    p2m_type_t *p2mt,
+                                    p2m_access_t *p2ma,
+                                    p2m_query_t q,
+                                    unsigned int *page_order,
+                                    bool_t *sve);
     void               (*enable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*disable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*flush_hardware_cached_dirty)(struct p2m_domain *p2m);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:42:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:42: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 1ZLAaN-0006e6-Il; Fri, 31 Jul 2015 13:42: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 1ZLAaL-0006dm-7k
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:53 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	C5/CC-10715-C5B7BB55; Fri, 31 Jul 2015 13:42:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350170!35429026!1
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 26395 invoked from network); 31 Jul 2015 13:42:50 -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;
	31 Jul 2015 13:42:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaH-0004ZG-Re
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaH-0007Hj-Qb
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:42:49 +0000
Date: Fri, 31 Jul 2015 13:42:49 +0000
Message-Id: <E1ZLAaH-0007Hj-Qb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add control of suppress_ve
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00e5fe6a83421766d5138c0cdf331e2e2b499da5
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri Jul 24 13:30:44 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:32:42 2015 +0200

    x86/altp2m: add control of suppress_ve
    
    The existing ept_set_entry() and ept_get_entry() routines are extended
    to optionally set/get suppress_ve.  Passing -1 will set suppress_ve on
    new p2m entries, or retain suppress_ve flag on existing entries.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    
    Also adjust the caller in set_identity_p2m_entry().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/mem_sharing.c |    4 +-
 xen/arch/x86/mm/p2m-ept.c     |   16 ++++++++++--
 xen/arch/x86/mm/p2m-pod.c     |   12 +++++-----
 xen/arch/x86/mm/p2m-pt.c      |   10 ++++++-
 xen/arch/x86/mm/p2m.c         |   50 ++++++++++++++++++++--------------------
 xen/include/asm-x86/p2m.h     |   24 ++++++++++---------
 6 files changed, 67 insertions(+), 49 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 1a01e45..d2e3786 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1260,7 +1260,7 @@ int relinquish_shared_pages(struct domain *d)
 
         if ( atomic_read(&d->shr_pages) == 0 )
             break;
-        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL);
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             /* Does not fail with ENOMEM given the DESTROY flag */
@@ -1270,7 +1270,7 @@ int relinquish_shared_pages(struct domain *d)
              * unshare.  Must succeed: we just read the old entry and
              * we hold the p2m lock. */
             set_rc = p2m->set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_4K,
-                                    p2m_invalid, p2m_access_rwx);
+                                    p2m_invalid, p2m_access_rwx, -1);
             ASSERT(set_rc == 0);
             count += 0x10;
         }
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index b532811..b4c65f9 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -658,7 +658,8 @@ bool_t ept_handle_misconfig(uint64_t gpa)
  */
 static int
 ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, 
-              unsigned int order, p2m_type_t p2mt, p2m_access_t p2ma)
+              unsigned int order, p2m_type_t p2mt, p2m_access_t p2ma,
+              int sve)
 {
     ept_entry_t *table, *ept_entry = NULL;
     unsigned long gfn_remainder = gfn;
@@ -804,7 +805,11 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
 
-    new_entry.suppress_ve = 1;
+    if ( sve != -1 )
+        new_entry.suppress_ve = !!sve;
+    else
+        new_entry.suppress_ve = is_epte_valid(&old_entry) ?
+                                    old_entry.suppress_ve : 1;
 
     rc = atomic_write_ept_entry(ept_entry, new_entry, target);
     if ( unlikely(rc) )
@@ -852,7 +857,8 @@ out:
 /* Read ept p2m entries */
 static mfn_t ept_get_entry(struct p2m_domain *p2m,
                            unsigned long gfn, p2m_type_t *t, p2m_access_t* a,
-                           p2m_query_t q, unsigned int *page_order)
+                           p2m_query_t q, unsigned int *page_order,
+                           bool_t *sve)
 {
     ept_entry_t *table = map_domain_page(_mfn(pagetable_get_pfn(p2m_get_pagetable(p2m))));
     unsigned long gfn_remainder = gfn;
@@ -866,6 +872,8 @@ static mfn_t ept_get_entry(struct p2m_domain *p2m,
 
     *t = p2m_mmio_dm;
     *a = p2m_access_n;
+    if ( sve )
+        *sve = 1;
 
     /* This pfn is higher than the highest the p2m map currently holds */
     if ( gfn > p2m->max_mapped_pfn )
@@ -931,6 +939,8 @@ static mfn_t ept_get_entry(struct p2m_domain *p2m,
         else
             *t = ept_entry->sa_p2mt;
         *a = ept_entry->access;
+        if ( sve )
+            *sve = ept_entry->suppress_ve;
 
         mfn = _mfn(ept_entry->mfn);
         if ( i )
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 6e27bcd..6aee85a 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -536,7 +536,7 @@ recount:
         p2m_access_t a;
         p2m_type_t t;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
 
         if ( t == p2m_populate_on_demand )
             pod++;
@@ -587,7 +587,7 @@ recount:
         p2m_type_t t;
         p2m_access_t a;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
         if ( t == p2m_populate_on_demand )
         {
             p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
@@ -676,7 +676,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
 
         if ( i == 0 )
         {
@@ -808,7 +808,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
     for ( i=0; i<count; i++ )
     {
         p2m_access_t a;
-        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL);
+        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL, NULL);
         /* If this is ram, and not a pagetable or from the xen heap, and probably not mapped
            elsewhere, map it; otherwise, skip. */
         if ( p2m_is_ram(types[i])
@@ -947,7 +947,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
     for ( i=p2m->pod.reclaim_single; i > 0 ; i-- )
     {
         p2m_access_t a;
-        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL);
+        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL, NULL);
         if ( p2m_is_ram(t) )
         {
             gfns[j] = i;
@@ -1135,7 +1135,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a6dd464..926de0b 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -482,7 +482,8 @@ int p2m_pt_handle_deferred_changes(uint64_t gpa)
 /* Returns: 0 for success, -errno for failure */
 static int
 p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
-                 unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma)
+                 unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma,
+                 int sve)
 {
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
@@ -495,6 +496,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
     unsigned long old_mfn = 0;
 
+    ASSERT(sve != 0);
+
     if ( tb_init_done )
     {
         struct {
@@ -689,7 +692,7 @@ static inline p2m_type_t recalc_type(bool_t recalc, p2m_type_t t,
 static mfn_t
 p2m_pt_get_entry(struct p2m_domain *p2m, unsigned long gfn,
                  p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
-                 unsigned int *page_order)
+                 unsigned int *page_order, bool_t *sve)
 {
     mfn_t mfn;
     paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
@@ -701,6 +704,9 @@ p2m_pt_get_entry(struct p2m_domain *p2m, unsigned long gfn,
 
     ASSERT(paging_mode_translate(p2m->domain));
 
+    if ( sve )
+        *sve = 1;
+
     /* XXX This is for compatibility with the old model, where anything not 
      * XXX marked as RAM was considered to be emulated MMIO space.
      * XXX Once we start explicitly registering MMIO regions in the p2m 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index e4a3f4a..0126dc0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -345,7 +345,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
         /* Grab the lock here, don't release until put_gfn */
         gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
+    mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order, NULL);
 
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
@@ -354,7 +354,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
          * sleeping. */
         if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
             (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
-        mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
+        mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order, NULL);
     }
 
     if (unlikely((p2m_is_broken(*t))))
@@ -458,7 +458,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         else
             order = 0;
 
-        set_rc = p2m->set_entry(p2m, gfn, mfn, order, p2mt, p2ma);
+        set_rc = p2m->set_entry(p2m, gfn, mfn, order, p2mt, p2ma, -1);
         if ( set_rc )
             rc = set_rc;
 
@@ -622,7 +622,7 @@ p2m_remove_page(struct p2m_domain *p2m, unsigned long gfn, unsigned long mfn,
     {
         for ( i = 0; i < (1UL << page_order); i++ )
         {
-            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
+            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL, NULL);
             if ( !p2m_is_grant(t) && !p2m_is_shared(t) && !p2m_is_foreign(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
@@ -687,7 +687,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
     /* First, remove m->p mappings for existing p->m mappings */
     for ( i = 0; i < (1UL << page_order); i++ )
     {
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
         if ( p2m_is_shared(ot) )
         {
             /* Do an unshare to cleanly take care of all corner 
@@ -711,7 +711,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
                 (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
-            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
+            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
         if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
@@ -759,7 +759,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
              * address */
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
-            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL);
+            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL, NULL);
             if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
@@ -826,7 +826,7 @@ int p2m_change_type_one(struct domain *d, unsigned long gfn,
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL, NULL);
     rc = likely(pt == ot)
          ? p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt,
                          p2m->default_access)
@@ -910,7 +910,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL, NULL);
     if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
     {
         p2m_unlock(p2m);
@@ -962,7 +962,7 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm )
         ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
@@ -998,7 +998,7 @@ int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    actual_mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
+    actual_mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(actual_mfn)) || (t != p2m_mmio_direct) )
@@ -1034,7 +1034,7 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
         return -EIO;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL, NULL);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
     ASSERT(p2m_is_shared(ot));
@@ -1086,7 +1086,7 @@ int p2m_mem_paging_nominate(struct domain *d, unsigned long gfn)
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     /* Check if mfn is valid */
     if ( !mfn_valid(mfn) )
@@ -1148,7 +1148,7 @@ int p2m_mem_paging_evict(struct domain *d, unsigned long gfn)
     gfn_lock(p2m, gfn, 0);
 
     /* Get mfn */
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
     if ( unlikely(!mfn_valid(mfn)) )
         goto out;
 
@@ -1280,7 +1280,7 @@ void p2m_mem_paging_populate(struct domain *d, unsigned long gfn)
 
     /* Fix p2m mapping */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
     /* Allow only nominated or evicted pages to enter page-in path */
     if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
     {
@@ -1342,7 +1342,7 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
 
     ret = -ENOENT;
     /* Allow missing pages */
@@ -1430,7 +1430,7 @@ void p2m_mem_paging_resume(struct domain *d, vm_event_response_t *rsp)
         unsigned long gfn = rsp->u.mem_access.gfn;
 
         gfn_lock(p2m, gfn, 0);
-        mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL, NULL);
         /*
          * Allow only pages which were prepared properly, or pages which
          * were nominated but not evicted.
@@ -1579,11 +1579,11 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
      * These calls to p2m->set_entry() must succeed: we have the gfn
      * locked and just did a successful get_entry(). */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, NULL);
 
     if ( npfec.write_access && p2ma == p2m_access_rx2rw ) 
     {
-        rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt, p2m_access_rw);
+        rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt, p2m_access_rw, -1);
         ASSERT(rc == 0);
         gfn_unlock(p2m, gfn, 0);
         return 1;
@@ -1592,7 +1592,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     {
         ASSERT(npfec.write_access || npfec.read_access || npfec.insn_fetch);
         rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
-                            p2mt, p2m_access_rwx);
+                            p2mt, p2m_access_rwx, -1);
         ASSERT(rc == 0);
     }
     gfn_unlock(p2m, gfn, 0);
@@ -1612,14 +1612,14 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
         else
         {
             gfn_lock(p2m, gfn, 0);
-            mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+            mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, NULL);
             if ( p2ma != p2m_access_n2rwx )
             {
                 /* A listener is not required, so clear the access
                  * restrictions.  This set must succeed: we have the
                  * gfn locked and just did a successful get_entry(). */
                 rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
-                                    p2mt, p2m_access_rwx);
+                                    p2mt, p2m_access_rwx, -1);
                 ASSERT(rc == 0);
             }
             gfn_unlock(p2m, gfn, 0);
@@ -1750,8 +1750,8 @@ long p2m_set_mem_access(struct domain *d, gfn_t gfn, uint32_t nr,
     p2m_lock(p2m);
     for ( gfn_l = gfn_x(gfn) + start; nr > start; ++gfn_l )
     {
-        mfn = p2m->get_entry(p2m, gfn_l, &t, &_a, 0, NULL);
-        rc = p2m->set_entry(p2m, gfn_l, mfn, PAGE_ORDER_4K, t, a);
+        mfn = p2m->get_entry(p2m, gfn_l, &t, &_a, 0, NULL, NULL);
+        rc = p2m->set_entry(p2m, gfn_l, mfn, PAGE_ORDER_4K, t, a, -1);
         if ( rc )
             break;
 
@@ -1800,7 +1800,7 @@ int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t *access)
     }
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn_x(gfn), &t, &a, 0, NULL);
+    mfn = p2m->get_entry(p2m, gfn_x(gfn), &t, &a, 0, NULL, NULL);
     gfn_unlock(p2m, gfn, 0);
 
     if ( mfn_x(mfn) == INVALID_MFN )
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b6539c8..f5188c0 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -226,17 +226,19 @@ struct p2m_domain {
     /* Pages used to construct the p2m */
     struct page_list_head pages;
 
-    int                (*set_entry   )(struct p2m_domain *p2m,
-                                       unsigned long gfn,
-                                       mfn_t mfn, unsigned int page_order,
-                                       p2m_type_t p2mt,
-                                       p2m_access_t p2ma);
-    mfn_t              (*get_entry   )(struct p2m_domain *p2m,
-                                       unsigned long gfn,
-                                       p2m_type_t *p2mt,
-                                       p2m_access_t *p2ma,
-                                       p2m_query_t q,
-                                       unsigned int *page_order);
+    int                (*set_entry)(struct p2m_domain *p2m,
+                                    unsigned long gfn,
+                                    mfn_t mfn, unsigned int page_order,
+                                    p2m_type_t p2mt,
+                                    p2m_access_t p2ma,
+                                    int sve);
+    mfn_t              (*get_entry)(struct p2m_domain *p2m,
+                                    unsigned long gfn,
+                                    p2m_type_t *p2mt,
+                                    p2m_access_t *p2ma,
+                                    p2m_query_t q,
+                                    unsigned int *page_order,
+                                    bool_t *sve);
     void               (*enable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*disable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*flush_hardware_cached_dirty)(struct p2m_domain *p2m);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:43:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAaV-0006gB-OG; Fri, 31 Jul 2015 13:43: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 1ZLAaU-0006fo-Da
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:02 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	B7/D1-14422-56B7BB55; Fri, 31 Jul 2015 13:43:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350180!24965403!1
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 5774 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaS-0004ZS-24
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaR-0007IP-WD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:00 +0000
Date: Fri, 31 Jul 2015 13:42:59 +0000
Message-Id: <E1ZLAaR-0007IP-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: alternate p2m memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1aae2f6ec52b7cb125416d417bde646141f4465
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:34:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:34:46 2015 +0200

    x86/altp2m: alternate p2m memory events
    
    Add a flag to indicate that a memory event occurred in an alternate p2m
    and a field containing the p2m index. Allow any event response to switch
    to a different alternate p2m using the same flag and field.
    
    Modify p2m_mem_access_check() to handle alternate p2m's.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> for the x86 bits.
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Tamas K Lengyel <tlengyel@novetta.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/p2m.c         |   19 ++++++++++++++++++-
 xen/common/vm_event.c         |    4 ++++
 xen/include/asm-arm/p2m.h     |    6 ++++++
 xen/include/asm-x86/p2m.h     |    3 +++
 xen/include/public/vm_event.h |   12 ++++++++++++
 5 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 0126dc0..d90b2d0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1560,6 +1560,12 @@ void p2m_mem_access_emulate_check(struct vcpu *v,
     }
 }
 
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
+{
+    if ( altp2m_active(v->domain) )
+        p2m_switch_vcpu_altp2m_by_id(v, idx);
+}
+
 bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
                             struct npfec npfec,
                             vm_event_request_t **req_ptr)
@@ -1567,7 +1573,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     struct vcpu *v = current;
     unsigned long gfn = gpa >> PAGE_SHIFT;
     struct domain *d = v->domain;    
-    struct p2m_domain* p2m = p2m_get_hostp2m(d);
+    struct p2m_domain *p2m = NULL;
     mfn_t mfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
@@ -1575,6 +1581,11 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     int rc;
     unsigned long eip = guest_cpu_user_regs()->eip;
 
+    if ( altp2m_active(d) )
+        p2m = p2m_get_altp2m(v);
+    if ( !p2m )
+        p2m = p2m_get_hostp2m(d);
+
     /* First, handle rx2rw conversion automatically.
      * These calls to p2m->set_entry() must succeed: we have the gfn
      * locked and just did a successful get_entry(). */
@@ -1689,6 +1700,12 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
         req->vcpu_id = v->vcpu_id;
 
         p2m_vm_event_fill_regs(req);
+
+        if ( altp2m_active(v->domain) )
+        {
+            req->flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+            req->altp2m_idx = vcpu_altp2m(v).p2midx;
+        }
     }
 
     /* Pause the current VCPU */
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index 4c6bf98..f3a8736 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -412,6 +412,10 @@ void vm_event_resume(struct domain *d, struct vm_event_domain *ved)
 
         };
 
+        /* Check for altp2m switch */
+        if ( rsp.flags & VM_EVENT_FLAG_ALTERNATE_P2M )
+            p2m_altp2m_check(v, rsp.altp2m_idx);
+
         if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
         {
             if ( rsp.flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 63748ef..08bdce3 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -109,6 +109,12 @@ void p2m_mem_access_emulate_check(struct vcpu *v,
     /* Not supported on ARM. */
 }
 
+static inline
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
+{
+    /* Not supported on ARM. */
+}
+
 #define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
 #define p2m_is_ram(_t)      ((_t) == p2m_ram_rw || (_t) == p2m_ram_ro)
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index f5188c0..30511fe 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -762,6 +762,9 @@ unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp);
 /* Switch alternate p2m for a single vcpu */
 bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
 
+/* Check to see if vcpu should be switched to a different p2m. */
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx);
+
 /*
  * p2m type to IOMMU flags
  */
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index fbc76b2..ff2f217 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -79,6 +79,16 @@
   * Currently only useful for MSR, CR0, CR3 and CR4 write events.
   */
 #define VM_EVENT_FLAG_DENY               (1 << 6)
+/*
+ * This flag can be set in a request or a response
+ *
+ * On a request, indicates that the event occurred in the alternate p2m specified by
+ * the altp2m_idx request field.
+ *
+ * On a response, indicates that the VCPU should resume in the alternate p2m specified
+ * by the altp2m_idx response field if possible.
+ */
+#define VM_EVENT_FLAG_ALTERNATE_P2M      (1 << 7)
 
 /*
  * Reasons for the vm event request
@@ -221,6 +231,8 @@ typedef struct vm_event_st {
     uint32_t flags;     /* VM_EVENT_FLAG_* */
     uint32_t reason;    /* VM_EVENT_REASON_* */
     uint32_t vcpu_id;
+    uint16_t altp2m_idx; /* may be used during request and response */
+    uint16_t _pad[3];
 
     union {
         struct vm_event_paging                mem_paging;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:43:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAaV-0006gB-OG; Fri, 31 Jul 2015 13:43: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 1ZLAaU-0006fo-Da
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:02 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	B7/D1-14422-56B7BB55; Fri, 31 Jul 2015 13:43:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350180!24965403!1
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 5774 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaS-0004ZS-24
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaR-0007IP-WD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:00 +0000
Date: Fri, 31 Jul 2015 13:42:59 +0000
Message-Id: <E1ZLAaR-0007IP-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: alternate p2m memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1aae2f6ec52b7cb125416d417bde646141f4465
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:34:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:34:46 2015 +0200

    x86/altp2m: alternate p2m memory events
    
    Add a flag to indicate that a memory event occurred in an alternate p2m
    and a field containing the p2m index. Allow any event response to switch
    to a different alternate p2m using the same flag and field.
    
    Modify p2m_mem_access_check() to handle alternate p2m's.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> for the x86 bits.
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Tamas K Lengyel <tlengyel@novetta.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/p2m.c         |   19 ++++++++++++++++++-
 xen/common/vm_event.c         |    4 ++++
 xen/include/asm-arm/p2m.h     |    6 ++++++
 xen/include/asm-x86/p2m.h     |    3 +++
 xen/include/public/vm_event.h |   12 ++++++++++++
 5 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 0126dc0..d90b2d0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1560,6 +1560,12 @@ void p2m_mem_access_emulate_check(struct vcpu *v,
     }
 }
 
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
+{
+    if ( altp2m_active(v->domain) )
+        p2m_switch_vcpu_altp2m_by_id(v, idx);
+}
+
 bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
                             struct npfec npfec,
                             vm_event_request_t **req_ptr)
@@ -1567,7 +1573,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     struct vcpu *v = current;
     unsigned long gfn = gpa >> PAGE_SHIFT;
     struct domain *d = v->domain;    
-    struct p2m_domain* p2m = p2m_get_hostp2m(d);
+    struct p2m_domain *p2m = NULL;
     mfn_t mfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
@@ -1575,6 +1581,11 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     int rc;
     unsigned long eip = guest_cpu_user_regs()->eip;
 
+    if ( altp2m_active(d) )
+        p2m = p2m_get_altp2m(v);
+    if ( !p2m )
+        p2m = p2m_get_hostp2m(d);
+
     /* First, handle rx2rw conversion automatically.
      * These calls to p2m->set_entry() must succeed: we have the gfn
      * locked and just did a successful get_entry(). */
@@ -1689,6 +1700,12 @@ bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla,
         req->vcpu_id = v->vcpu_id;
 
         p2m_vm_event_fill_regs(req);
+
+        if ( altp2m_active(v->domain) )
+        {
+            req->flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+            req->altp2m_idx = vcpu_altp2m(v).p2midx;
+        }
     }
 
     /* Pause the current VCPU */
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index 4c6bf98..f3a8736 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -412,6 +412,10 @@ void vm_event_resume(struct domain *d, struct vm_event_domain *ved)
 
         };
 
+        /* Check for altp2m switch */
+        if ( rsp.flags & VM_EVENT_FLAG_ALTERNATE_P2M )
+            p2m_altp2m_check(v, rsp.altp2m_idx);
+
         if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
         {
             if ( rsp.flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 63748ef..08bdce3 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -109,6 +109,12 @@ void p2m_mem_access_emulate_check(struct vcpu *v,
     /* Not supported on ARM. */
 }
 
+static inline
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
+{
+    /* Not supported on ARM. */
+}
+
 #define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
 #define p2m_is_ram(_t)      ((_t) == p2m_ram_rw || (_t) == p2m_ram_ro)
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index f5188c0..30511fe 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -762,6 +762,9 @@ unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp);
 /* Switch alternate p2m for a single vcpu */
 bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
 
+/* Check to see if vcpu should be switched to a different p2m. */
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx);
+
 /*
  * p2m type to IOMMU flags
  */
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index fbc76b2..ff2f217 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -79,6 +79,16 @@
   * Currently only useful for MSR, CR0, CR3 and CR4 write events.
   */
 #define VM_EVENT_FLAG_DENY               (1 << 6)
+/*
+ * This flag can be set in a request or a response
+ *
+ * On a request, indicates that the event occurred in the alternate p2m specified by
+ * the altp2m_idx request field.
+ *
+ * On a response, indicates that the VCPU should resume in the alternate p2m specified
+ * by the altp2m_idx response field if possible.
+ */
+#define VM_EVENT_FLAG_ALTERNATE_P2M      (1 << 7)
 
 /*
  * Reasons for the vm event request
@@ -221,6 +231,8 @@ typedef struct vm_event_st {
     uint32_t flags;     /* VM_EVENT_FLAG_* */
     uint32_t reason;    /* VM_EVENT_REASON_* */
     uint32_t vcpu_id;
+    uint16_t altp2m_idx; /* may be used during request and response */
+    uint16_t _pad[3];
 
     union {
         struct vm_event_paging                mem_paging;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:43:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAag-0006ha-R6; Fri, 31 Jul 2015 13:43:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaf-0006hK-Kx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:14 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	00/EF-01421-07B7BB55; Fri, 31 Jul 2015 13:43:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438350190!31067676!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 28296 invoked from network); 31 Jul 2015 13:43:11 -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;
	31 Jul 2015 13:43:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAac-0004a3-8j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAac-0007J3-6L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:10 +0000
Date: Fri, 31 Jul 2015 13:43:10 +0000
Message-Id: <E1ZLAac-0007J3-6L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add remaining support
	routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e939ef96fbb26fbbcb435891afb091d4f810ea3
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:36:15 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:36:15 2015 +0200

    x86/altp2m: add remaining support routines
    
    Add the remaining routines required to support enabling the alternate
    p2m functionality.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    
    Fix off-by-one in various checks against MAX_ALTP2M. Adjust error code
    in p2m_destroy_altp2m_by_id(). Cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c    |   61 ++++++-
 xen/arch/x86/mm/p2m-ept.c |    3 +
 xen/arch/x86/mm/p2m.c     |  438 +++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/p2m.h |   39 ++++
 4 files changed, 535 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8c2ace1..63f9856 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2856,10 +2856,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     mfn_t mfn;
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
-    struct p2m_domain *p2m;
+    struct p2m_domain *p2m, *hostp2m;
     int rc, fall_through = 0, paged = 0;
     int sharing_enomem = 0;
     vm_event_request_t *req_ptr = NULL;
+    bool_t ap2m_active;
 
     /* On Nested Virtualization, walk the guest page table.
      * If this succeeds, all is fine.
@@ -2919,11 +2920,32 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         goto out;
     }
 
-    p2m = p2m_get_hostp2m(currd);
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
+    ap2m_active = altp2m_active(currd);
+
+    /*
+     * Take a lock on the host p2m speculatively, to avoid potential
+     * locking order problems later and to handle unshare etc.
+     */
+    hostp2m = p2m_get_hostp2m(currd);
+    mfn = get_gfn_type_access(hostp2m, gfn, &p2mt, &p2ma,
                               P2M_ALLOC | (npfec.write_access ? P2M_UNSHARE : 0),
                               NULL);
 
+    if ( ap2m_active )
+    {
+        if ( p2m_altp2m_lazy_copy(curr, gpa, gla, npfec, &p2m) )
+        {
+            /* entry was lazily copied from host -- retry */
+            __put_gfn(hostp2m, gfn);
+            rc = 1;
+            goto out;
+        }
+
+        mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+    }
+    else
+        p2m = hostp2m;
+
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
     {
@@ -2963,6 +2985,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 
         if ( violation )
         {
+            /* Should #VE be emulated for this fault? */
+            if ( p2m_is_altp2m(p2m) && !cpu_has_vmx_virt_exceptions )
+            {
+                bool_t sve;
+
+                p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, &sve);
+
+                if ( !sve && altp2m_vcpu_emulate_ve(curr) )
+                {
+                    rc = 1;
+                    goto out_put_gfn;
+                }
+            }
+
             if ( p2m_mem_access_check(gpa, gla, npfec, &req_ptr) )
             {
                 fall_through = 1;
@@ -2982,7 +3018,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
          (npfec.write_access &&
           (p2m_is_discard_write(p2mt) || (p2mt == p2m_mmio_write_dm))) )
     {
-        put_gfn(currd, gfn);
+        __put_gfn(p2m, gfn);
+        if ( ap2m_active )
+            __put_gfn(hostp2m, gfn);
 
         rc = 0;
         if ( unlikely(is_pvh_domain(currd)) )
@@ -3011,6 +3049,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     /* Spurious fault? PoD and log-dirty also take this path. */
     if ( p2m_is_ram(p2mt) )
     {
+        rc = 1;
         /*
          * Page log dirty is always done with order 0. If this mfn resides in
          * a large page, we do not change other pages type within that large
@@ -3019,9 +3058,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         if ( npfec.write_access )
         {
             paging_mark_dirty(currd, mfn_x(mfn));
+            /*
+             * If p2m is really an altp2m, unlock here to avoid lock ordering
+             * violation when the change below is propagated from host p2m.
+             */
+            if ( ap2m_active )
+                __put_gfn(p2m, gfn);
             p2m_change_type_one(currd, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            __put_gfn(ap2m_active ? hostp2m : p2m, gfn);
+
+            goto out;
         }
-        rc = 1;
         goto out_put_gfn;
     }
 
@@ -3031,7 +3078,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     rc = fall_through;
 
 out_put_gfn:
-    put_gfn(currd, gfn);
+    __put_gfn(p2m, gfn);
+    if ( ap2m_active )
+        __put_gfn(hostp2m, gfn);
 out:
     /* All of these are delayed until we exit, since we might 
      * sleep on event ring wait queues, and we must not hold
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index b4c65f9..dc82518 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -851,6 +851,9 @@ out:
     if ( is_epte_present(&old_entry) )
         ept_free_entry(p2m, &old_entry, target);
 
+    if ( rc == 0 && p2m_is_hostp2m(p2m) )
+        p2m_altp2m_propagate_change(d, _gfn(gfn), mfn, order, p2mt, p2ma);
+
     return rc;
 }
 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index d90b2d0..ff8be31 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2097,6 +2097,444 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
     return rc;
 }
 
+/*
+ * If the fault is for a not present entry:
+ *     if the entry in the host p2m has a valid mfn, copy it and retry
+ *     else indicate that outer handler should handle fault
+ *
+ * If the fault is for a present entry:
+ *     indicate that outer handler should handle fault
+ */
+
+bool_t p2m_altp2m_lazy_copy(struct vcpu *v, paddr_t gpa,
+                            unsigned long gla, struct npfec npfec,
+                            struct p2m_domain **ap2m)
+{
+    struct p2m_domain *hp2m = p2m_get_hostp2m(v->domain);
+    p2m_type_t p2mt;
+    p2m_access_t p2ma;
+    unsigned int page_order;
+    gfn_t gfn = _gfn(paddr_to_pfn(gpa));
+    unsigned long mask;
+    mfn_t mfn;
+    int rv;
+
+    *ap2m = p2m_get_altp2m(v);
+
+    mfn = get_gfn_type_access(*ap2m, gfn_x(gfn), &p2mt, &p2ma,
+                              0, &page_order);
+    __put_gfn(*ap2m, gfn_x(gfn));
+
+    if ( mfn_x(mfn) != INVALID_MFN )
+        return 0;
+
+    mfn = get_gfn_type_access(hp2m, gfn_x(gfn), &p2mt, &p2ma,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order);
+    __put_gfn(hp2m, gfn_x(gfn));
+
+    if ( mfn_x(mfn) == INVALID_MFN )
+        return 0;
+
+    p2m_lock(*ap2m);
+
+    /*
+     * If this is a superpage mapping, round down both frame numbers
+     * to the start of the superpage.
+     */
+    mask = ~((1UL << page_order) - 1);
+    mfn = _mfn(mfn_x(mfn) & mask);
+
+    rv = p2m_set_entry(*ap2m, gfn_x(gfn) & mask, mfn, page_order, p2mt, p2ma);
+    p2m_unlock(*ap2m);
+
+    if ( rv )
+    {
+        gdprintk(XENLOG_ERR,
+	    "failed to set entry for %#"PRIx64" -> %#"PRIx64" p2m %#"PRIx64"\n",
+	    gfn_x(gfn), mfn_x(mfn), (unsigned long)*ap2m);
+        domain_crash(hp2m->domain);
+    }
+
+    return 1;
+}
+
+void p2m_flush_altp2m(struct domain *d)
+{
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        p2m_flush_table(d->arch.altp2m_p2m[i]);
+        /* Uninit and reinit ept to force TLB shootdown */
+        ept_p2m_uninit(d->arch.altp2m_p2m[i]);
+        ept_p2m_init(d->arch.altp2m_p2m[i]);
+        d->arch.altp2m_eptp[i] = INVALID_MFN;
+    }
+
+    altp2m_list_unlock(d);
+}
+
+static void p2m_init_altp2m_helper(struct domain *d, unsigned int i)
+{
+    struct p2m_domain *p2m = d->arch.altp2m_p2m[i];
+    struct ept_data *ept;
+
+    p2m->min_remapped_gfn = INVALID_GFN;
+    p2m->max_remapped_gfn = 0;
+    ept = &p2m->ept;
+    ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m));
+    d->arch.altp2m_eptp[i] = ept_get_eptp(ept);
+}
+
+int p2m_init_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M )
+        return rc;
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] == INVALID_MFN )
+    {
+        p2m_init_altp2m_helper(d, idx);
+        rc = 0;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
+int p2m_init_next_altp2m(struct domain *d, uint16_t *idx)
+{
+    int rc = -EINVAL;
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] != INVALID_MFN )
+            continue;
+
+        p2m_init_altp2m_helper(d, i);
+        *idx = i;
+        rc = 0;
+
+        break;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
+int p2m_destroy_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    struct p2m_domain *p2m;
+    int rc = -EBUSY;
+
+    if ( !idx || idx >= MAX_ALTP2M )
+        return rc;
+
+    domain_pause_except_self(d);
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        p2m = d->arch.altp2m_p2m[idx];
+
+        if ( !_atomic_read(p2m->active_vcpus) )
+        {
+            p2m_flush_table(d->arch.altp2m_p2m[idx]);
+            /* Uninit and reinit ept to force TLB shootdown */
+            ept_p2m_uninit(d->arch.altp2m_p2m[idx]);
+            ept_p2m_init(d->arch.altp2m_p2m[idx]);
+            d->arch.altp2m_eptp[idx] = INVALID_MFN;
+            rc = 0;
+        }
+    }
+
+    altp2m_list_unlock(d);
+
+    domain_unpause_except_self(d);
+
+    return rc;
+}
+
+int p2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    struct vcpu *v;
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M )
+        return rc;
+
+    domain_pause_except_self(d);
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        for_each_vcpu( d, v )
+            if ( idx != vcpu_altp2m(v).p2midx )
+            {
+                atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+                vcpu_altp2m(v).p2midx = idx;
+                atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+                altp2m_vcpu_update_p2m(v);
+            }
+
+        rc = 0;
+    }
+
+    altp2m_list_unlock(d);
+
+    domain_unpause_except_self(d);
+
+    return rc;
+}
+
+int p2m_set_altp2m_mem_access(struct domain *d, unsigned int idx,
+                              gfn_t gfn, xenmem_access_t access)
+{
+    struct p2m_domain *hp2m, *ap2m;
+    p2m_access_t req_a, old_a;
+    p2m_type_t t;
+    mfn_t mfn;
+    unsigned int page_order;
+    int rc = -EINVAL;
+
+    static const p2m_access_t memaccess[] = {
+#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
+        ACCESS(n),
+        ACCESS(r),
+        ACCESS(w),
+        ACCESS(rw),
+        ACCESS(x),
+        ACCESS(rx),
+        ACCESS(wx),
+        ACCESS(rwx),
+#undef ACCESS
+    };
+
+    if ( idx >= MAX_ALTP2M || d->arch.altp2m_eptp[idx] == INVALID_MFN )
+        return rc;
+
+    ap2m = d->arch.altp2m_p2m[idx];
+
+    switch ( access )
+    {
+    case 0 ... ARRAY_SIZE(memaccess) - 1:
+        req_a = memaccess[access];
+        break;
+    case XENMEM_access_default:
+        req_a = ap2m->default_access;
+        break;
+    default:
+        return rc;
+    }
+
+    /* If request to set default access */
+    if ( gfn_x(gfn) == INVALID_GFN )
+    {
+        ap2m->default_access = req_a;
+        return 0;
+    }
+
+    hp2m = p2m_get_hostp2m(d);
+
+    p2m_lock(ap2m);
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(gfn), &t, &old_a, 0, NULL, NULL);
+
+    /* Check host p2m if no valid entry in alternate */
+    if ( !mfn_valid(mfn) )
+    {
+        mfn = hp2m->get_entry(hp2m, gfn_x(gfn), &t, &old_a,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order, NULL);
+
+        if ( !mfn_valid(mfn) || t != p2m_ram_rw )
+            goto out;
+
+        /* If this is a superpage, copy that first */
+        if ( page_order != PAGE_ORDER_4K )
+        {
+            gfn_t gfn2;
+            unsigned long mask;
+            mfn_t mfn2;
+
+            mask = ~((1UL << page_order) - 1);
+            gfn2 = _gfn(gfn_x(gfn) & mask);
+            mfn2 = _mfn(mfn_x(mfn) & mask);
+
+            if ( ap2m->set_entry(ap2m, gfn_x(gfn2), mfn2, page_order, t, old_a, 1) )
+                goto out;
+        }
+    }
+
+    if ( !ap2m->set_entry(ap2m, gfn_x(gfn), mfn, PAGE_ORDER_4K, t, req_a,
+                          (current->domain != d)) )
+        rc = 0;
+
+ out:
+    p2m_unlock(ap2m);
+    return rc;
+}
+
+int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx,
+                          gfn_t old_gfn, gfn_t new_gfn)
+{
+    struct p2m_domain *hp2m, *ap2m;
+    p2m_access_t a;
+    p2m_type_t t;
+    mfn_t mfn;
+    unsigned int page_order;
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M || d->arch.altp2m_eptp[idx] == INVALID_MFN )
+        return rc;
+
+    hp2m = p2m_get_hostp2m(d);
+    ap2m = d->arch.altp2m_p2m[idx];
+
+    p2m_lock(ap2m);
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(old_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( gfn_x(new_gfn) == INVALID_GFN )
+    {
+        if ( mfn_valid(mfn) )
+            p2m_remove_page(ap2m, gfn_x(old_gfn), mfn_x(mfn), PAGE_ORDER_4K);
+        rc = 0;
+        goto out;
+    }
+
+    /* Check host p2m if no valid entry in alternate */
+    if ( !mfn_valid(mfn) )
+    {
+        mfn = hp2m->get_entry(hp2m, gfn_x(old_gfn), &t, &a,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order, NULL);
+
+        if ( !mfn_valid(mfn) || t != p2m_ram_rw )
+            goto out;
+
+        /* If this is a superpage, copy that first */
+        if ( page_order != PAGE_ORDER_4K )
+        {
+            gfn_t gfn;
+            unsigned long mask;
+
+            mask = ~((1UL << page_order) - 1);
+            gfn = _gfn(gfn_x(old_gfn) & mask);
+            mfn = _mfn(mfn_x(mfn) & mask);
+
+            if ( ap2m->set_entry(ap2m, gfn_x(gfn), mfn, page_order, t, a, 1) )
+                goto out;
+        }
+    }
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(new_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( !mfn_valid(mfn) )
+        mfn = hp2m->get_entry(hp2m, gfn_x(new_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( !mfn_valid(mfn) || (t != p2m_ram_rw) )
+        goto out;
+
+    if ( !ap2m->set_entry(ap2m, gfn_x(old_gfn), mfn, PAGE_ORDER_4K, t, a,
+                          (current->domain != d)) )
+    {
+        rc = 0;
+
+        if ( gfn_x(new_gfn) < ap2m->min_remapped_gfn )
+            ap2m->min_remapped_gfn = gfn_x(new_gfn);
+        if ( gfn_x(new_gfn) > ap2m->max_remapped_gfn )
+            ap2m->max_remapped_gfn = gfn_x(new_gfn);
+    }
+
+ out:
+    p2m_unlock(ap2m);
+    return rc;
+}
+
+static void p2m_reset_altp2m(struct p2m_domain *p2m)
+{
+    p2m_flush_table(p2m);
+    /* Uninit and reinit ept to force TLB shootdown */
+    ept_p2m_uninit(p2m);
+    ept_p2m_init(p2m);
+    p2m->min_remapped_gfn = INVALID_GFN;
+    p2m->max_remapped_gfn = 0;
+}
+
+void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
+                                 mfn_t mfn, unsigned int page_order,
+                                 p2m_type_t p2mt, p2m_access_t p2ma)
+{
+    struct p2m_domain *p2m;
+    p2m_access_t a;
+    p2m_type_t t;
+    mfn_t m;
+    unsigned int i;
+    unsigned int reset_count = 0;
+    unsigned int last_reset_idx = ~0;
+
+    if ( !altp2m_active(d) )
+        return;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] == INVALID_MFN )
+            continue;
+
+        p2m = d->arch.altp2m_p2m[i];
+        m = get_gfn_type_access(p2m, gfn_x(gfn), &t, &a, 0, NULL);
+
+        /* Check for a dropped page that may impact this altp2m */
+        if ( mfn_x(mfn) == INVALID_MFN &&
+             gfn_x(gfn) >= p2m->min_remapped_gfn &&
+             gfn_x(gfn) <= p2m->max_remapped_gfn )
+        {
+            if ( !reset_count++ )
+            {
+                p2m_reset_altp2m(p2m);
+                last_reset_idx = i;
+            }
+            else
+            {
+                /* At least 2 altp2m's impacted, so reset everything */
+                __put_gfn(p2m, gfn_x(gfn));
+
+                for ( i = 0; i < MAX_ALTP2M; i++ )
+                {
+                    if ( i == last_reset_idx ||
+                         d->arch.altp2m_eptp[i] == INVALID_MFN )
+                        continue;
+
+                    p2m = d->arch.altp2m_p2m[i];
+                    p2m_lock(p2m);
+                    p2m_reset_altp2m(p2m);
+                    p2m_unlock(p2m);
+                }
+
+                goto out;
+            }
+        }
+        else if ( mfn_x(m) != INVALID_MFN )
+            p2m_set_entry(p2m, gfn_x(gfn), mfn, page_order, p2mt, p2ma);
+
+        __put_gfn(p2m, gfn_x(gfn));
+    }
+
+ out:
+    altp2m_list_unlock(d);
+}
+
 /*** Audit ***/
 
 #if P2M_AUDIT
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 30511fe..44203fb 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -268,6 +268,13 @@ struct p2m_domain {
     /* Highest guest frame that's ever been mapped in the p2m */
     unsigned long max_mapped_pfn;
 
+    /*
+     * Alternate p2m's only: range of gfn's for which underlying
+     * mfn may have duplicate mappings
+     */
+    unsigned long min_remapped_gfn;
+    unsigned long max_remapped_gfn;
+
     /* When releasing shared gfn's in a preemptible manner, recall where
      * to resume the search */
     unsigned long next_shared_gfn_to_relinquish;
@@ -765,6 +772,38 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
 /* Check to see if vcpu should be switched to a different p2m. */
 void p2m_altp2m_check(struct vcpu *v, uint16_t idx);
 
+/* Flush all the alternate p2m's for a domain */
+void p2m_flush_altp2m(struct domain *d);
+
+/* Alternate p2m paging */
+bool_t p2m_altp2m_lazy_copy(struct vcpu *v, paddr_t gpa,
+    unsigned long gla, struct npfec npfec, struct p2m_domain **ap2m);
+
+/* Make a specific alternate p2m valid */
+int p2m_init_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Find an available alternate p2m and make it valid */
+int p2m_init_next_altp2m(struct domain *d, uint16_t *idx);
+
+/* Make a specific alternate p2m invalid */
+int p2m_destroy_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Switch alternate p2m for entire domain */
+int p2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Set access type for a gfn */
+int p2m_set_altp2m_mem_access(struct domain *d, unsigned int idx,
+                              gfn_t gfn, xenmem_access_t access);
+
+/* Change a gfn->mfn mapping */
+int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx,
+                          gfn_t old_gfn, gfn_t new_gfn);
+
+/* Propagate a host p2m change to all alternate p2m's */
+void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
+                                 mfn_t mfn, unsigned int page_order,
+                                 p2m_type_t p2mt, p2m_access_t p2ma);
+
 /*
  * p2m type to IOMMU 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 Fri Jul 31 13:43:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAag-0006ha-R6; Fri, 31 Jul 2015 13:43:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaf-0006hK-Kx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:14 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	00/EF-01421-07B7BB55; Fri, 31 Jul 2015 13:43:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438350190!31067676!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 28296 invoked from network); 31 Jul 2015 13:43:11 -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;
	31 Jul 2015 13:43:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAac-0004a3-8j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAac-0007J3-6L
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:10 +0000
Date: Fri, 31 Jul 2015 13:43:10 +0000
Message-Id: <E1ZLAac-0007J3-6L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add remaining support
	routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e939ef96fbb26fbbcb435891afb091d4f810ea3
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:36:15 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:36:15 2015 +0200

    x86/altp2m: add remaining support routines
    
    Add the remaining routines required to support enabling the alternate
    p2m functionality.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    
    Fix off-by-one in various checks against MAX_ALTP2M. Adjust error code
    in p2m_destroy_altp2m_by_id(). Cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c    |   61 ++++++-
 xen/arch/x86/mm/p2m-ept.c |    3 +
 xen/arch/x86/mm/p2m.c     |  438 +++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/p2m.h |   39 ++++
 4 files changed, 535 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8c2ace1..63f9856 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2856,10 +2856,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     mfn_t mfn;
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
-    struct p2m_domain *p2m;
+    struct p2m_domain *p2m, *hostp2m;
     int rc, fall_through = 0, paged = 0;
     int sharing_enomem = 0;
     vm_event_request_t *req_ptr = NULL;
+    bool_t ap2m_active;
 
     /* On Nested Virtualization, walk the guest page table.
      * If this succeeds, all is fine.
@@ -2919,11 +2920,32 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         goto out;
     }
 
-    p2m = p2m_get_hostp2m(currd);
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
+    ap2m_active = altp2m_active(currd);
+
+    /*
+     * Take a lock on the host p2m speculatively, to avoid potential
+     * locking order problems later and to handle unshare etc.
+     */
+    hostp2m = p2m_get_hostp2m(currd);
+    mfn = get_gfn_type_access(hostp2m, gfn, &p2mt, &p2ma,
                               P2M_ALLOC | (npfec.write_access ? P2M_UNSHARE : 0),
                               NULL);
 
+    if ( ap2m_active )
+    {
+        if ( p2m_altp2m_lazy_copy(curr, gpa, gla, npfec, &p2m) )
+        {
+            /* entry was lazily copied from host -- retry */
+            __put_gfn(hostp2m, gfn);
+            rc = 1;
+            goto out;
+        }
+
+        mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 0, NULL);
+    }
+    else
+        p2m = hostp2m;
+
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
     {
@@ -2963,6 +2985,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 
         if ( violation )
         {
+            /* Should #VE be emulated for this fault? */
+            if ( p2m_is_altp2m(p2m) && !cpu_has_vmx_virt_exceptions )
+            {
+                bool_t sve;
+
+                p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL, &sve);
+
+                if ( !sve && altp2m_vcpu_emulate_ve(curr) )
+                {
+                    rc = 1;
+                    goto out_put_gfn;
+                }
+            }
+
             if ( p2m_mem_access_check(gpa, gla, npfec, &req_ptr) )
             {
                 fall_through = 1;
@@ -2982,7 +3018,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
          (npfec.write_access &&
           (p2m_is_discard_write(p2mt) || (p2mt == p2m_mmio_write_dm))) )
     {
-        put_gfn(currd, gfn);
+        __put_gfn(p2m, gfn);
+        if ( ap2m_active )
+            __put_gfn(hostp2m, gfn);
 
         rc = 0;
         if ( unlikely(is_pvh_domain(currd)) )
@@ -3011,6 +3049,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     /* Spurious fault? PoD and log-dirty also take this path. */
     if ( p2m_is_ram(p2mt) )
     {
+        rc = 1;
         /*
          * Page log dirty is always done with order 0. If this mfn resides in
          * a large page, we do not change other pages type within that large
@@ -3019,9 +3058,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         if ( npfec.write_access )
         {
             paging_mark_dirty(currd, mfn_x(mfn));
+            /*
+             * If p2m is really an altp2m, unlock here to avoid lock ordering
+             * violation when the change below is propagated from host p2m.
+             */
+            if ( ap2m_active )
+                __put_gfn(p2m, gfn);
             p2m_change_type_one(currd, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            __put_gfn(ap2m_active ? hostp2m : p2m, gfn);
+
+            goto out;
         }
-        rc = 1;
         goto out_put_gfn;
     }
 
@@ -3031,7 +3078,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     rc = fall_through;
 
 out_put_gfn:
-    put_gfn(currd, gfn);
+    __put_gfn(p2m, gfn);
+    if ( ap2m_active )
+        __put_gfn(hostp2m, gfn);
 out:
     /* All of these are delayed until we exit, since we might 
      * sleep on event ring wait queues, and we must not hold
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index b4c65f9..dc82518 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -851,6 +851,9 @@ out:
     if ( is_epte_present(&old_entry) )
         ept_free_entry(p2m, &old_entry, target);
 
+    if ( rc == 0 && p2m_is_hostp2m(p2m) )
+        p2m_altp2m_propagate_change(d, _gfn(gfn), mfn, order, p2mt, p2ma);
+
     return rc;
 }
 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index d90b2d0..ff8be31 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2097,6 +2097,444 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
     return rc;
 }
 
+/*
+ * If the fault is for a not present entry:
+ *     if the entry in the host p2m has a valid mfn, copy it and retry
+ *     else indicate that outer handler should handle fault
+ *
+ * If the fault is for a present entry:
+ *     indicate that outer handler should handle fault
+ */
+
+bool_t p2m_altp2m_lazy_copy(struct vcpu *v, paddr_t gpa,
+                            unsigned long gla, struct npfec npfec,
+                            struct p2m_domain **ap2m)
+{
+    struct p2m_domain *hp2m = p2m_get_hostp2m(v->domain);
+    p2m_type_t p2mt;
+    p2m_access_t p2ma;
+    unsigned int page_order;
+    gfn_t gfn = _gfn(paddr_to_pfn(gpa));
+    unsigned long mask;
+    mfn_t mfn;
+    int rv;
+
+    *ap2m = p2m_get_altp2m(v);
+
+    mfn = get_gfn_type_access(*ap2m, gfn_x(gfn), &p2mt, &p2ma,
+                              0, &page_order);
+    __put_gfn(*ap2m, gfn_x(gfn));
+
+    if ( mfn_x(mfn) != INVALID_MFN )
+        return 0;
+
+    mfn = get_gfn_type_access(hp2m, gfn_x(gfn), &p2mt, &p2ma,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order);
+    __put_gfn(hp2m, gfn_x(gfn));
+
+    if ( mfn_x(mfn) == INVALID_MFN )
+        return 0;
+
+    p2m_lock(*ap2m);
+
+    /*
+     * If this is a superpage mapping, round down both frame numbers
+     * to the start of the superpage.
+     */
+    mask = ~((1UL << page_order) - 1);
+    mfn = _mfn(mfn_x(mfn) & mask);
+
+    rv = p2m_set_entry(*ap2m, gfn_x(gfn) & mask, mfn, page_order, p2mt, p2ma);
+    p2m_unlock(*ap2m);
+
+    if ( rv )
+    {
+        gdprintk(XENLOG_ERR,
+	    "failed to set entry for %#"PRIx64" -> %#"PRIx64" p2m %#"PRIx64"\n",
+	    gfn_x(gfn), mfn_x(mfn), (unsigned long)*ap2m);
+        domain_crash(hp2m->domain);
+    }
+
+    return 1;
+}
+
+void p2m_flush_altp2m(struct domain *d)
+{
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        p2m_flush_table(d->arch.altp2m_p2m[i]);
+        /* Uninit and reinit ept to force TLB shootdown */
+        ept_p2m_uninit(d->arch.altp2m_p2m[i]);
+        ept_p2m_init(d->arch.altp2m_p2m[i]);
+        d->arch.altp2m_eptp[i] = INVALID_MFN;
+    }
+
+    altp2m_list_unlock(d);
+}
+
+static void p2m_init_altp2m_helper(struct domain *d, unsigned int i)
+{
+    struct p2m_domain *p2m = d->arch.altp2m_p2m[i];
+    struct ept_data *ept;
+
+    p2m->min_remapped_gfn = INVALID_GFN;
+    p2m->max_remapped_gfn = 0;
+    ept = &p2m->ept;
+    ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m));
+    d->arch.altp2m_eptp[i] = ept_get_eptp(ept);
+}
+
+int p2m_init_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M )
+        return rc;
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] == INVALID_MFN )
+    {
+        p2m_init_altp2m_helper(d, idx);
+        rc = 0;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
+int p2m_init_next_altp2m(struct domain *d, uint16_t *idx)
+{
+    int rc = -EINVAL;
+    unsigned int i;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] != INVALID_MFN )
+            continue;
+
+        p2m_init_altp2m_helper(d, i);
+        *idx = i;
+        rc = 0;
+
+        break;
+    }
+
+    altp2m_list_unlock(d);
+    return rc;
+}
+
+int p2m_destroy_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    struct p2m_domain *p2m;
+    int rc = -EBUSY;
+
+    if ( !idx || idx >= MAX_ALTP2M )
+        return rc;
+
+    domain_pause_except_self(d);
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        p2m = d->arch.altp2m_p2m[idx];
+
+        if ( !_atomic_read(p2m->active_vcpus) )
+        {
+            p2m_flush_table(d->arch.altp2m_p2m[idx]);
+            /* Uninit and reinit ept to force TLB shootdown */
+            ept_p2m_uninit(d->arch.altp2m_p2m[idx]);
+            ept_p2m_init(d->arch.altp2m_p2m[idx]);
+            d->arch.altp2m_eptp[idx] = INVALID_MFN;
+            rc = 0;
+        }
+    }
+
+    altp2m_list_unlock(d);
+
+    domain_unpause_except_self(d);
+
+    return rc;
+}
+
+int p2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx)
+{
+    struct vcpu *v;
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M )
+        return rc;
+
+    domain_pause_except_self(d);
+
+    altp2m_list_lock(d);
+
+    if ( d->arch.altp2m_eptp[idx] != INVALID_MFN )
+    {
+        for_each_vcpu( d, v )
+            if ( idx != vcpu_altp2m(v).p2midx )
+            {
+                atomic_dec(&p2m_get_altp2m(v)->active_vcpus);
+                vcpu_altp2m(v).p2midx = idx;
+                atomic_inc(&p2m_get_altp2m(v)->active_vcpus);
+                altp2m_vcpu_update_p2m(v);
+            }
+
+        rc = 0;
+    }
+
+    altp2m_list_unlock(d);
+
+    domain_unpause_except_self(d);
+
+    return rc;
+}
+
+int p2m_set_altp2m_mem_access(struct domain *d, unsigned int idx,
+                              gfn_t gfn, xenmem_access_t access)
+{
+    struct p2m_domain *hp2m, *ap2m;
+    p2m_access_t req_a, old_a;
+    p2m_type_t t;
+    mfn_t mfn;
+    unsigned int page_order;
+    int rc = -EINVAL;
+
+    static const p2m_access_t memaccess[] = {
+#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
+        ACCESS(n),
+        ACCESS(r),
+        ACCESS(w),
+        ACCESS(rw),
+        ACCESS(x),
+        ACCESS(rx),
+        ACCESS(wx),
+        ACCESS(rwx),
+#undef ACCESS
+    };
+
+    if ( idx >= MAX_ALTP2M || d->arch.altp2m_eptp[idx] == INVALID_MFN )
+        return rc;
+
+    ap2m = d->arch.altp2m_p2m[idx];
+
+    switch ( access )
+    {
+    case 0 ... ARRAY_SIZE(memaccess) - 1:
+        req_a = memaccess[access];
+        break;
+    case XENMEM_access_default:
+        req_a = ap2m->default_access;
+        break;
+    default:
+        return rc;
+    }
+
+    /* If request to set default access */
+    if ( gfn_x(gfn) == INVALID_GFN )
+    {
+        ap2m->default_access = req_a;
+        return 0;
+    }
+
+    hp2m = p2m_get_hostp2m(d);
+
+    p2m_lock(ap2m);
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(gfn), &t, &old_a, 0, NULL, NULL);
+
+    /* Check host p2m if no valid entry in alternate */
+    if ( !mfn_valid(mfn) )
+    {
+        mfn = hp2m->get_entry(hp2m, gfn_x(gfn), &t, &old_a,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order, NULL);
+
+        if ( !mfn_valid(mfn) || t != p2m_ram_rw )
+            goto out;
+
+        /* If this is a superpage, copy that first */
+        if ( page_order != PAGE_ORDER_4K )
+        {
+            gfn_t gfn2;
+            unsigned long mask;
+            mfn_t mfn2;
+
+            mask = ~((1UL << page_order) - 1);
+            gfn2 = _gfn(gfn_x(gfn) & mask);
+            mfn2 = _mfn(mfn_x(mfn) & mask);
+
+            if ( ap2m->set_entry(ap2m, gfn_x(gfn2), mfn2, page_order, t, old_a, 1) )
+                goto out;
+        }
+    }
+
+    if ( !ap2m->set_entry(ap2m, gfn_x(gfn), mfn, PAGE_ORDER_4K, t, req_a,
+                          (current->domain != d)) )
+        rc = 0;
+
+ out:
+    p2m_unlock(ap2m);
+    return rc;
+}
+
+int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx,
+                          gfn_t old_gfn, gfn_t new_gfn)
+{
+    struct p2m_domain *hp2m, *ap2m;
+    p2m_access_t a;
+    p2m_type_t t;
+    mfn_t mfn;
+    unsigned int page_order;
+    int rc = -EINVAL;
+
+    if ( idx >= MAX_ALTP2M || d->arch.altp2m_eptp[idx] == INVALID_MFN )
+        return rc;
+
+    hp2m = p2m_get_hostp2m(d);
+    ap2m = d->arch.altp2m_p2m[idx];
+
+    p2m_lock(ap2m);
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(old_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( gfn_x(new_gfn) == INVALID_GFN )
+    {
+        if ( mfn_valid(mfn) )
+            p2m_remove_page(ap2m, gfn_x(old_gfn), mfn_x(mfn), PAGE_ORDER_4K);
+        rc = 0;
+        goto out;
+    }
+
+    /* Check host p2m if no valid entry in alternate */
+    if ( !mfn_valid(mfn) )
+    {
+        mfn = hp2m->get_entry(hp2m, gfn_x(old_gfn), &t, &a,
+                              P2M_ALLOC | P2M_UNSHARE, &page_order, NULL);
+
+        if ( !mfn_valid(mfn) || t != p2m_ram_rw )
+            goto out;
+
+        /* If this is a superpage, copy that first */
+        if ( page_order != PAGE_ORDER_4K )
+        {
+            gfn_t gfn;
+            unsigned long mask;
+
+            mask = ~((1UL << page_order) - 1);
+            gfn = _gfn(gfn_x(old_gfn) & mask);
+            mfn = _mfn(mfn_x(mfn) & mask);
+
+            if ( ap2m->set_entry(ap2m, gfn_x(gfn), mfn, page_order, t, a, 1) )
+                goto out;
+        }
+    }
+
+    mfn = ap2m->get_entry(ap2m, gfn_x(new_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( !mfn_valid(mfn) )
+        mfn = hp2m->get_entry(hp2m, gfn_x(new_gfn), &t, &a, 0, NULL, NULL);
+
+    if ( !mfn_valid(mfn) || (t != p2m_ram_rw) )
+        goto out;
+
+    if ( !ap2m->set_entry(ap2m, gfn_x(old_gfn), mfn, PAGE_ORDER_4K, t, a,
+                          (current->domain != d)) )
+    {
+        rc = 0;
+
+        if ( gfn_x(new_gfn) < ap2m->min_remapped_gfn )
+            ap2m->min_remapped_gfn = gfn_x(new_gfn);
+        if ( gfn_x(new_gfn) > ap2m->max_remapped_gfn )
+            ap2m->max_remapped_gfn = gfn_x(new_gfn);
+    }
+
+ out:
+    p2m_unlock(ap2m);
+    return rc;
+}
+
+static void p2m_reset_altp2m(struct p2m_domain *p2m)
+{
+    p2m_flush_table(p2m);
+    /* Uninit and reinit ept to force TLB shootdown */
+    ept_p2m_uninit(p2m);
+    ept_p2m_init(p2m);
+    p2m->min_remapped_gfn = INVALID_GFN;
+    p2m->max_remapped_gfn = 0;
+}
+
+void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
+                                 mfn_t mfn, unsigned int page_order,
+                                 p2m_type_t p2mt, p2m_access_t p2ma)
+{
+    struct p2m_domain *p2m;
+    p2m_access_t a;
+    p2m_type_t t;
+    mfn_t m;
+    unsigned int i;
+    unsigned int reset_count = 0;
+    unsigned int last_reset_idx = ~0;
+
+    if ( !altp2m_active(d) )
+        return;
+
+    altp2m_list_lock(d);
+
+    for ( i = 0; i < MAX_ALTP2M; i++ )
+    {
+        if ( d->arch.altp2m_eptp[i] == INVALID_MFN )
+            continue;
+
+        p2m = d->arch.altp2m_p2m[i];
+        m = get_gfn_type_access(p2m, gfn_x(gfn), &t, &a, 0, NULL);
+
+        /* Check for a dropped page that may impact this altp2m */
+        if ( mfn_x(mfn) == INVALID_MFN &&
+             gfn_x(gfn) >= p2m->min_remapped_gfn &&
+             gfn_x(gfn) <= p2m->max_remapped_gfn )
+        {
+            if ( !reset_count++ )
+            {
+                p2m_reset_altp2m(p2m);
+                last_reset_idx = i;
+            }
+            else
+            {
+                /* At least 2 altp2m's impacted, so reset everything */
+                __put_gfn(p2m, gfn_x(gfn));
+
+                for ( i = 0; i < MAX_ALTP2M; i++ )
+                {
+                    if ( i == last_reset_idx ||
+                         d->arch.altp2m_eptp[i] == INVALID_MFN )
+                        continue;
+
+                    p2m = d->arch.altp2m_p2m[i];
+                    p2m_lock(p2m);
+                    p2m_reset_altp2m(p2m);
+                    p2m_unlock(p2m);
+                }
+
+                goto out;
+            }
+        }
+        else if ( mfn_x(m) != INVALID_MFN )
+            p2m_set_entry(p2m, gfn_x(gfn), mfn, page_order, p2mt, p2ma);
+
+        __put_gfn(p2m, gfn_x(gfn));
+    }
+
+ out:
+    altp2m_list_unlock(d);
+}
+
 /*** Audit ***/
 
 #if P2M_AUDIT
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 30511fe..44203fb 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -268,6 +268,13 @@ struct p2m_domain {
     /* Highest guest frame that's ever been mapped in the p2m */
     unsigned long max_mapped_pfn;
 
+    /*
+     * Alternate p2m's only: range of gfn's for which underlying
+     * mfn may have duplicate mappings
+     */
+    unsigned long min_remapped_gfn;
+    unsigned long max_remapped_gfn;
+
     /* When releasing shared gfn's in a preemptible manner, recall where
      * to resume the search */
     unsigned long next_shared_gfn_to_relinquish;
@@ -765,6 +772,38 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
 /* Check to see if vcpu should be switched to a different p2m. */
 void p2m_altp2m_check(struct vcpu *v, uint16_t idx);
 
+/* Flush all the alternate p2m's for a domain */
+void p2m_flush_altp2m(struct domain *d);
+
+/* Alternate p2m paging */
+bool_t p2m_altp2m_lazy_copy(struct vcpu *v, paddr_t gpa,
+    unsigned long gla, struct npfec npfec, struct p2m_domain **ap2m);
+
+/* Make a specific alternate p2m valid */
+int p2m_init_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Find an available alternate p2m and make it valid */
+int p2m_init_next_altp2m(struct domain *d, uint16_t *idx);
+
+/* Make a specific alternate p2m invalid */
+int p2m_destroy_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Switch alternate p2m for entire domain */
+int p2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx);
+
+/* Set access type for a gfn */
+int p2m_set_altp2m_mem_access(struct domain *d, unsigned int idx,
+                              gfn_t gfn, xenmem_access_t access);
+
+/* Change a gfn->mfn mapping */
+int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx,
+                          gfn_t old_gfn, gfn_t new_gfn);
+
+/* Propagate a host p2m change to all alternate p2m's */
+void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
+                                 mfn_t mfn, unsigned int page_order,
+                                 p2m_type_t p2mt, p2m_access_t p2ma);
+
 /*
  * p2m type to IOMMU 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 Fri Jul 31 13:43:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAap-0006iz-Ti; Fri, 31 Jul 2015 13:43: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 1ZLAap-0006il-5d
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:23 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	1B/21-06021-A7B7BB55; Fri, 31 Jul 2015 13:43:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350200!31132294!1
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 28927 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAam-0004aB-I1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAam-0007Jg-DT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:20 +0000
Date: Fri, 31 Jul 2015 13:43:20 +0000
Message-Id: <E1ZLAam-0007Jg-DT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: define and implement
	alternate p2m HVMOP types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit affa72690c32ae576722eb628b3459ac3709b2b6
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:36:50 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:36:50 2015 +0200

    x86/altp2m: define and implement alternate p2m HVMOP types
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c          |  138 +++++++++++++++++++++++++++++++++++++++
 xen/include/public/hvm/hvm_op.h |   89 +++++++++++++++++++++++++
 2 files changed, 227 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 63f9856..dd70d87 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6136,6 +6136,140 @@ static int hvmop_get_param(
     return rc;
 }
 
+static int do_altp2m_op(
+    XEN_GUEST_HANDLE_PARAM(void) arg)
+{
+    struct xen_hvm_altp2m_op a;
+    struct domain *d = NULL;
+    int rc = 0;
+
+    if ( !hvm_altp2m_supported() )
+        return -EOPNOTSUPP;
+
+    if ( copy_from_guest(&a, arg, 1) )
+        return -EFAULT;
+
+    if ( a.pad1 || a.pad2 ||
+         (a.version != HVMOP_ALTP2M_INTERFACE_VERSION) ||
+         (a.cmd < HVMOP_altp2m_get_domain_state) ||
+         (a.cmd > HVMOP_altp2m_change_gfn) )
+        return -EINVAL;
+
+    d = (a.cmd != HVMOP_altp2m_vcpu_enable_notify) ?
+        rcu_lock_domain_by_any_id(a.domain) : rcu_lock_current_domain();
+
+    if ( d == NULL )
+        return -ESRCH;
+
+    if ( !is_hvm_domain(d) )
+    {
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    if ( (a.cmd != HVMOP_altp2m_get_domain_state) &&
+         (a.cmd != HVMOP_altp2m_set_domain_state) &&
+         !d->arch.altp2m_active )
+    {
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    switch ( a.cmd )
+    {
+    case HVMOP_altp2m_get_domain_state:
+        a.u.domain_state.state = altp2m_active(d);
+        rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+        break;
+
+    case HVMOP_altp2m_set_domain_state:
+    {
+        struct vcpu *v;
+        bool_t ostate;
+
+        if ( nestedhvm_enabled(d) )
+        {
+            rc = -EINVAL;
+            break;
+        }
+
+        ostate = d->arch.altp2m_active;
+        d->arch.altp2m_active = !!a.u.domain_state.state;
+
+        /* If the alternate p2m state has changed, handle appropriately */
+        if ( d->arch.altp2m_active != ostate &&
+             (ostate || !(rc = p2m_init_altp2m_by_id(d, 0))) )
+        {
+            for_each_vcpu( d, v )
+            {
+                if ( !ostate )
+                    altp2m_vcpu_initialise(v);
+                else
+                    altp2m_vcpu_destroy(v);
+            }
+
+            if ( ostate )
+                p2m_flush_altp2m(d);
+        }
+        break;
+    }
+
+    case HVMOP_altp2m_vcpu_enable_notify:
+    {
+        struct vcpu *curr = current;
+        p2m_type_t p2mt;
+
+        if ( a.u.enable_notify.pad || a.domain != DOMID_SELF ||
+             a.u.enable_notify.vcpu_id != curr->vcpu_id )
+            rc = -EINVAL;
+
+        if ( (gfn_x(vcpu_altp2m(curr).veinfo_gfn) != INVALID_GFN) ||
+             (mfn_x(get_gfn_query_unlocked(curr->domain,
+                    a.u.enable_notify.gfn, &p2mt)) == INVALID_MFN) )
+            return -EINVAL;
+
+        vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn);
+        altp2m_vcpu_update_vmfunc_ve(curr);
+        break;
+    }
+
+    case HVMOP_altp2m_create_p2m:
+        if ( !(rc = p2m_init_next_altp2m(d, &a.u.view.view)) )
+            rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+        break;
+
+    case HVMOP_altp2m_destroy_p2m:
+        rc = p2m_destroy_altp2m_by_id(d, a.u.view.view);
+        break;
+
+    case HVMOP_altp2m_switch_p2m:
+        rc = p2m_switch_domain_altp2m_by_id(d, a.u.view.view);
+        break;
+
+    case HVMOP_altp2m_set_mem_access:
+        if ( a.u.set_mem_access.pad )
+            rc = -EINVAL;
+        else
+            rc = p2m_set_altp2m_mem_access(d, a.u.set_mem_access.view,
+                    _gfn(a.u.set_mem_access.gfn),
+                    a.u.set_mem_access.hvmmem_access);
+        break;
+
+    case HVMOP_altp2m_change_gfn:
+        if ( a.u.change_gfn.pad1 || a.u.change_gfn.pad2 )
+            rc = -EINVAL;
+        else
+            rc = p2m_change_altp2m_gfn(d, a.u.change_gfn.view,
+                    _gfn(a.u.change_gfn.old_gfn),
+                    _gfn(a.u.change_gfn.new_gfn));
+    }
+
+ out:
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
 /*
  * Note that this value is effectively part of the ABI, even if we don't need
  * to make it a formal part of it: A guest suspended for migration in the
@@ -6565,6 +6699,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             rc = -EINVAL;
         break;
 
+    case HVMOP_altp2m:
+        rc = do_altp2m_op(arg);
+        break;
+
     default:
     {
         gdprintk(XENLOG_DEBUG, "Bad HVM op %ld.\n", op);
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index d053db9..014546a 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -398,6 +398,95 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_evtchn_upcall_vector_t);
 
 #define HVMOP_guest_request_vm_event 24
 
+/* HVMOP_altp2m: perform altp2m state operations */
+#define HVMOP_altp2m 25
+
+#define HVMOP_ALTP2M_INTERFACE_VERSION 0x00000001
+
+struct xen_hvm_altp2m_domain_state {
+    /* IN or OUT variable on/off */
+    uint8_t state;
+};
+typedef struct xen_hvm_altp2m_domain_state xen_hvm_altp2m_domain_state_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_domain_state_t);
+
+struct xen_hvm_altp2m_vcpu_enable_notify {
+    uint32_t vcpu_id;
+    uint32_t pad;
+    /* #VE info area gfn */
+    uint64_t gfn;
+};
+typedef struct xen_hvm_altp2m_vcpu_enable_notify xen_hvm_altp2m_vcpu_enable_notify_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_vcpu_enable_notify_t);
+
+struct xen_hvm_altp2m_view {
+    /* IN/OUT variable */
+    uint16_t view;
+    /* Create view only: default access type
+     * NOTE: currently ignored */
+    uint16_t hvmmem_default_access; /* xenmem_access_t */
+};
+typedef struct xen_hvm_altp2m_view xen_hvm_altp2m_view_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_view_t);
+
+struct xen_hvm_altp2m_set_mem_access {
+    /* view */
+    uint16_t view;
+    /* Memory type */
+    uint16_t hvmmem_access; /* xenmem_access_t */
+    uint32_t pad;
+    /* gfn */
+    uint64_t gfn;
+};
+typedef struct xen_hvm_altp2m_set_mem_access xen_hvm_altp2m_set_mem_access_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_set_mem_access_t);
+
+struct xen_hvm_altp2m_change_gfn {
+    /* view */
+    uint16_t view;
+    uint16_t pad1;
+    uint32_t pad2;
+    /* old gfn */
+    uint64_t old_gfn;
+    /* new gfn, INVALID_GFN (~0UL) means revert */
+    uint64_t new_gfn;
+};
+typedef struct xen_hvm_altp2m_change_gfn xen_hvm_altp2m_change_gfn_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_change_gfn_t);
+
+struct xen_hvm_altp2m_op {
+    uint32_t version;   /* HVMOP_ALTP2M_INTERFACE_VERSION */
+    uint32_t cmd;
+/* Get/set the altp2m state for a domain */
+#define HVMOP_altp2m_get_domain_state     1
+#define HVMOP_altp2m_set_domain_state     2
+/* Set the current VCPU to receive altp2m event notifications */
+#define HVMOP_altp2m_vcpu_enable_notify   3
+/* Create a new view */
+#define HVMOP_altp2m_create_p2m           4
+/* Destroy a view */
+#define HVMOP_altp2m_destroy_p2m          5
+/* Switch view for an entire domain */
+#define HVMOP_altp2m_switch_p2m           6
+/* Notify that a page of memory is to have specific access types */
+#define HVMOP_altp2m_set_mem_access       7
+/* Change a p2m entry to have a different gfn->mfn mapping */
+#define HVMOP_altp2m_change_gfn           8
+    domid_t domain;
+    uint16_t pad1;
+    uint32_t pad2;
+    union {
+        struct xen_hvm_altp2m_domain_state       domain_state;
+        struct xen_hvm_altp2m_vcpu_enable_notify enable_notify;
+        struct xen_hvm_altp2m_view               view;
+        struct xen_hvm_altp2m_set_mem_access     set_mem_access;
+        struct xen_hvm_altp2m_change_gfn         change_gfn;
+        uint8_t pad[64];
+    } u;
+};
+typedef struct xen_hvm_altp2m_op xen_hvm_altp2m_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_op_t);
+
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_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 Fri Jul 31 13:43:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAap-0006iz-Ti; Fri, 31 Jul 2015 13:43: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 1ZLAap-0006il-5d
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:23 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	1B/21-06021-A7B7BB55; Fri, 31 Jul 2015 13:43:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1438350200!31132294!1
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 28927 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAam-0004aB-I1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAam-0007Jg-DT
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:20 +0000
Date: Fri, 31 Jul 2015 13:43:20 +0000
Message-Id: <E1ZLAam-0007Jg-DT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: define and implement
	alternate p2m HVMOP types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit affa72690c32ae576722eb628b3459ac3709b2b6
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:36:50 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:36:50 2015 +0200

    x86/altp2m: define and implement alternate p2m HVMOP types
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c          |  138 +++++++++++++++++++++++++++++++++++++++
 xen/include/public/hvm/hvm_op.h |   89 +++++++++++++++++++++++++
 2 files changed, 227 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 63f9856..dd70d87 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6136,6 +6136,140 @@ static int hvmop_get_param(
     return rc;
 }
 
+static int do_altp2m_op(
+    XEN_GUEST_HANDLE_PARAM(void) arg)
+{
+    struct xen_hvm_altp2m_op a;
+    struct domain *d = NULL;
+    int rc = 0;
+
+    if ( !hvm_altp2m_supported() )
+        return -EOPNOTSUPP;
+
+    if ( copy_from_guest(&a, arg, 1) )
+        return -EFAULT;
+
+    if ( a.pad1 || a.pad2 ||
+         (a.version != HVMOP_ALTP2M_INTERFACE_VERSION) ||
+         (a.cmd < HVMOP_altp2m_get_domain_state) ||
+         (a.cmd > HVMOP_altp2m_change_gfn) )
+        return -EINVAL;
+
+    d = (a.cmd != HVMOP_altp2m_vcpu_enable_notify) ?
+        rcu_lock_domain_by_any_id(a.domain) : rcu_lock_current_domain();
+
+    if ( d == NULL )
+        return -ESRCH;
+
+    if ( !is_hvm_domain(d) )
+    {
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    if ( (a.cmd != HVMOP_altp2m_get_domain_state) &&
+         (a.cmd != HVMOP_altp2m_set_domain_state) &&
+         !d->arch.altp2m_active )
+    {
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    switch ( a.cmd )
+    {
+    case HVMOP_altp2m_get_domain_state:
+        a.u.domain_state.state = altp2m_active(d);
+        rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+        break;
+
+    case HVMOP_altp2m_set_domain_state:
+    {
+        struct vcpu *v;
+        bool_t ostate;
+
+        if ( nestedhvm_enabled(d) )
+        {
+            rc = -EINVAL;
+            break;
+        }
+
+        ostate = d->arch.altp2m_active;
+        d->arch.altp2m_active = !!a.u.domain_state.state;
+
+        /* If the alternate p2m state has changed, handle appropriately */
+        if ( d->arch.altp2m_active != ostate &&
+             (ostate || !(rc = p2m_init_altp2m_by_id(d, 0))) )
+        {
+            for_each_vcpu( d, v )
+            {
+                if ( !ostate )
+                    altp2m_vcpu_initialise(v);
+                else
+                    altp2m_vcpu_destroy(v);
+            }
+
+            if ( ostate )
+                p2m_flush_altp2m(d);
+        }
+        break;
+    }
+
+    case HVMOP_altp2m_vcpu_enable_notify:
+    {
+        struct vcpu *curr = current;
+        p2m_type_t p2mt;
+
+        if ( a.u.enable_notify.pad || a.domain != DOMID_SELF ||
+             a.u.enable_notify.vcpu_id != curr->vcpu_id )
+            rc = -EINVAL;
+
+        if ( (gfn_x(vcpu_altp2m(curr).veinfo_gfn) != INVALID_GFN) ||
+             (mfn_x(get_gfn_query_unlocked(curr->domain,
+                    a.u.enable_notify.gfn, &p2mt)) == INVALID_MFN) )
+            return -EINVAL;
+
+        vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn);
+        altp2m_vcpu_update_vmfunc_ve(curr);
+        break;
+    }
+
+    case HVMOP_altp2m_create_p2m:
+        if ( !(rc = p2m_init_next_altp2m(d, &a.u.view.view)) )
+            rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+        break;
+
+    case HVMOP_altp2m_destroy_p2m:
+        rc = p2m_destroy_altp2m_by_id(d, a.u.view.view);
+        break;
+
+    case HVMOP_altp2m_switch_p2m:
+        rc = p2m_switch_domain_altp2m_by_id(d, a.u.view.view);
+        break;
+
+    case HVMOP_altp2m_set_mem_access:
+        if ( a.u.set_mem_access.pad )
+            rc = -EINVAL;
+        else
+            rc = p2m_set_altp2m_mem_access(d, a.u.set_mem_access.view,
+                    _gfn(a.u.set_mem_access.gfn),
+                    a.u.set_mem_access.hvmmem_access);
+        break;
+
+    case HVMOP_altp2m_change_gfn:
+        if ( a.u.change_gfn.pad1 || a.u.change_gfn.pad2 )
+            rc = -EINVAL;
+        else
+            rc = p2m_change_altp2m_gfn(d, a.u.change_gfn.view,
+                    _gfn(a.u.change_gfn.old_gfn),
+                    _gfn(a.u.change_gfn.new_gfn));
+    }
+
+ out:
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
 /*
  * Note that this value is effectively part of the ABI, even if we don't need
  * to make it a formal part of it: A guest suspended for migration in the
@@ -6565,6 +6699,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             rc = -EINVAL;
         break;
 
+    case HVMOP_altp2m:
+        rc = do_altp2m_op(arg);
+        break;
+
     default:
     {
         gdprintk(XENLOG_DEBUG, "Bad HVM op %ld.\n", op);
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index d053db9..014546a 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -398,6 +398,95 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_evtchn_upcall_vector_t);
 
 #define HVMOP_guest_request_vm_event 24
 
+/* HVMOP_altp2m: perform altp2m state operations */
+#define HVMOP_altp2m 25
+
+#define HVMOP_ALTP2M_INTERFACE_VERSION 0x00000001
+
+struct xen_hvm_altp2m_domain_state {
+    /* IN or OUT variable on/off */
+    uint8_t state;
+};
+typedef struct xen_hvm_altp2m_domain_state xen_hvm_altp2m_domain_state_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_domain_state_t);
+
+struct xen_hvm_altp2m_vcpu_enable_notify {
+    uint32_t vcpu_id;
+    uint32_t pad;
+    /* #VE info area gfn */
+    uint64_t gfn;
+};
+typedef struct xen_hvm_altp2m_vcpu_enable_notify xen_hvm_altp2m_vcpu_enable_notify_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_vcpu_enable_notify_t);
+
+struct xen_hvm_altp2m_view {
+    /* IN/OUT variable */
+    uint16_t view;
+    /* Create view only: default access type
+     * NOTE: currently ignored */
+    uint16_t hvmmem_default_access; /* xenmem_access_t */
+};
+typedef struct xen_hvm_altp2m_view xen_hvm_altp2m_view_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_view_t);
+
+struct xen_hvm_altp2m_set_mem_access {
+    /* view */
+    uint16_t view;
+    /* Memory type */
+    uint16_t hvmmem_access; /* xenmem_access_t */
+    uint32_t pad;
+    /* gfn */
+    uint64_t gfn;
+};
+typedef struct xen_hvm_altp2m_set_mem_access xen_hvm_altp2m_set_mem_access_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_set_mem_access_t);
+
+struct xen_hvm_altp2m_change_gfn {
+    /* view */
+    uint16_t view;
+    uint16_t pad1;
+    uint32_t pad2;
+    /* old gfn */
+    uint64_t old_gfn;
+    /* new gfn, INVALID_GFN (~0UL) means revert */
+    uint64_t new_gfn;
+};
+typedef struct xen_hvm_altp2m_change_gfn xen_hvm_altp2m_change_gfn_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_change_gfn_t);
+
+struct xen_hvm_altp2m_op {
+    uint32_t version;   /* HVMOP_ALTP2M_INTERFACE_VERSION */
+    uint32_t cmd;
+/* Get/set the altp2m state for a domain */
+#define HVMOP_altp2m_get_domain_state     1
+#define HVMOP_altp2m_set_domain_state     2
+/* Set the current VCPU to receive altp2m event notifications */
+#define HVMOP_altp2m_vcpu_enable_notify   3
+/* Create a new view */
+#define HVMOP_altp2m_create_p2m           4
+/* Destroy a view */
+#define HVMOP_altp2m_destroy_p2m          5
+/* Switch view for an entire domain */
+#define HVMOP_altp2m_switch_p2m           6
+/* Notify that a page of memory is to have specific access types */
+#define HVMOP_altp2m_set_mem_access       7
+/* Change a p2m entry to have a different gfn->mfn mapping */
+#define HVMOP_altp2m_change_gfn           8
+    domid_t domain;
+    uint16_t pad1;
+    uint32_t pad2;
+    union {
+        struct xen_hvm_altp2m_domain_state       domain_state;
+        struct xen_hvm_altp2m_vcpu_enable_notify enable_notify;
+        struct xen_hvm_altp2m_view               view;
+        struct xen_hvm_altp2m_set_mem_access     set_mem_access;
+        struct xen_hvm_altp2m_change_gfn         change_gfn;
+        uint8_t pad[64];
+    } u;
+};
+typedef struct xen_hvm_altp2m_op xen_hvm_altp2m_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_op_t);
+
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_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 Fri Jul 31 13:43:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAb1-0006ku-2k; Fri, 31 Jul 2015 13:43:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaz-0006kc-M6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:33 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	CF/60-16618-58B7BB55; Fri, 31 Jul 2015 13:43:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1438350210!36920920!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 29416 invoked from network); 31 Jul 2015 13:43:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:43:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaw-0004aJ-Ps
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaw-0007Kj-Nf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:30 +0000
Date: Fri, 31 Jul 2015 13:43:30 +0000
Message-Id: <E1ZLAaw-0007Kj-Nf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add altp2mhvm HVM domain
	parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea214001287cd374275793235c500de9ef0b280d
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:38:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:38:28 2015 +0200

    x86/altp2m: add altp2mhvm HVM domain parameter
    
    The altp2mhvm and nestedhvm parameters are mutually
    exclusive and cannot be set together.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5           |   12 ++++++++++++
 tools/libxl/libxl.h             |    6 ++++++
 tools/libxl/libxl_create.c      |    1 +
 tools/libxl/libxl_dom.c         |    2 ++
 tools/libxl/libxl_types.idl     |    1 +
 tools/libxl/xl_cmdimpl.c        |   10 ++++++++++
 xen/arch/x86/hvm/hvm.c          |   21 ++++++++++++++++++++-
 xen/include/public/hvm/params.h |    5 ++++-
 8 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index ce7ce85..c78c3ba 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1130,6 +1130,18 @@ enabled by default and you should usually omit it. It may be necessary
 to disable the HPET in order to improve compatibility with guest
 Operating Systems (X86 only)
 
+=item B<altp2mhvm=BOOLEAN>
+
+Enables or disables hvm guest access to alternate-p2m capability.
+Alternate-p2m allows a guest to manage multiple p2m guest physical
+"memory views" (as opposed to a single p2m). This option is
+disabled by default and is available only to hvm domains.
+You may want this option if you want to access-control/isolate
+access to specific guest physical memory pages accessed by
+the guest, e.g. for HVM domain memory introspection or
+for isolation/access-control of memory between components within
+a single guest hvm domain.
+
 =item B<nestedhvm=BOOLEAN>
 
 Enable or disables guest access to hardware virtualisation features,
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 927b2d8..5f9047c 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -758,6 +758,12 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_BUILDINFO_SERIAL_LIST 1
 
 /*
+ * LIBXL_HAVE_ALTP2M
+ * If this is defined, then libxl supports alternate p2m functionality.
+ */
+#define LIBXL_HAVE_ALTP2M 1
+
+/*
  * LIBXL_HAVE_REMUS
  * If this is defined, then libxl supports remus.
  */
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index b27c53a..855b42c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -287,6 +287,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
         libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
         libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.altp2m,             false);
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 3f2fec3..b3ae5b5 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -301,6 +301,8 @@ static void hvm_set_conf_params(xc_interface *handle, uint32_t domid,
                     libxl_defbool_val(info->u.hvm.vpt_align));
     xc_hvm_param_set(handle, domid, HVM_PARAM_NESTEDHVM,
                     libxl_defbool_val(info->u.hvm.nested_hvm));
+    xc_hvm_param_set(handle, domid, HVM_PARAM_ALTP2M,
+                    libxl_defbool_val(info->u.hvm.altp2m));
 }
 
 int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9caaf44..ef346e7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -474,6 +474,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("mmio_hole_memkb",  MemKB),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
+                                       ("altp2m",           libxl_defbool),
                                        ("smbios_firmware",  string),
                                        ("acpi_firmware",    string),
                                        ("hdtype",           libxl_hdtype),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index de1c9c0..d0bf0cb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1566,6 +1566,16 @@ static void parse_config_data(const char *config_source,
 
         xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
 
+        xlu_cfg_get_defbool(config, "altp2mhvm", &b_info->u.hvm.altp2m, 0);
+
+        if (!libxl_defbool_is_default(b_info->u.hvm.nested_hvm) &&
+            libxl_defbool_val(b_info->u.hvm.nested_hvm) &&
+            !libxl_defbool_is_default(b_info->u.hvm.altp2m) &&
+            libxl_defbool_val(b_info->u.hvm.altp2m)) {
+            fprintf(stderr, "ERROR: nestedhvm and altp2mhvm cannot be used together\n");
+            exit(1);
+        }
+
         xlu_cfg_replace_string(config, "smbios_firmware",
                                &b_info->u.hvm.smbios_firmware, 0);
         xlu_cfg_replace_string(config, "acpi_firmware",
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index dd70d87..cb05e90 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5866,6 +5866,7 @@ static int hvm_allow_set_param(struct domain *d,
     case HVM_PARAM_VIRIDIAN:
     case HVM_PARAM_IOREQ_SERVER_PFN:
     case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+    case HVM_PARAM_ALTP2M:
         if ( value != 0 && a->value != value )
             rc = -EEXIST;
         break;
@@ -5988,6 +5989,9 @@ static int hvmop_set_param(
          */
         if ( cpu_has_svm && !paging_mode_hap(d) && a.value )
             rc = -EINVAL;
+        if ( a.value &&
+             d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] )
+            rc = -EINVAL;
         /* Set up NHVM state for any vcpus that are already up. */
         if ( a.value &&
              !d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
@@ -5998,6 +6002,13 @@ static int hvmop_set_param(
             for_each_vcpu(d, v)
                 nestedhvm_vcpu_destroy(v);
         break;
+    case HVM_PARAM_ALTP2M:
+        if ( a.value > 1 )
+            rc = -EINVAL;
+        if ( a.value &&
+             d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
+            rc = -EINVAL;
+        break;
     case HVM_PARAM_BUFIOREQ_EVTCHN:
         rc = -EINVAL;
         break;
@@ -6058,6 +6069,7 @@ static int hvm_allow_get_param(struct domain *d,
     case HVM_PARAM_STORE_EVTCHN:
     case HVM_PARAM_CONSOLE_PFN:
     case HVM_PARAM_CONSOLE_EVTCHN:
+    case HVM_PARAM_ALTP2M:
         break;
     /*
      * The following parameters must not be read by the guest
@@ -6178,6 +6190,12 @@ static int do_altp2m_op(
     switch ( a.cmd )
     {
     case HVMOP_altp2m_get_domain_state:
+        if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] )
+        {
+            rc = -EINVAL;
+            break;
+        }
+
         a.u.domain_state.state = altp2m_active(d);
         rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
         break;
@@ -6187,7 +6205,8 @@ static int do_altp2m_op(
         struct vcpu *v;
         bool_t ostate;
 
-        if ( nestedhvm_enabled(d) )
+        if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] ||
+             nestedhvm_enabled(d) )
         {
             rc = -EINVAL;
             break;
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 7c73089..147d9b8 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -187,6 +187,9 @@
 /* Location of the VM Generation ID in guest physical address space. */
 #define HVM_PARAM_VM_GENERATION_ID_ADDR 34
 
-#define HVM_NR_PARAMS          35
+/* Boolean: Enable altp2m */
+#define HVM_PARAM_ALTP2M       35
+
+#define HVM_NR_PARAMS          36
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_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 Fri Jul 31 13:43:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAb1-0006ku-2k; Fri, 31 Jul 2015 13:43:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaz-0006kc-M6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:33 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	CF/60-16618-58B7BB55; Fri, 31 Jul 2015 13:43:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1438350210!36920920!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 29416 invoked from network); 31 Jul 2015 13:43:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:43:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaw-0004aJ-Ps
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAaw-0007Kj-Nf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:30 +0000
Date: Fri, 31 Jul 2015 13:43:30 +0000
Message-Id: <E1ZLAaw-0007Kj-Nf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: add altp2mhvm HVM domain
	parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea214001287cd374275793235c500de9ef0b280d
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Fri Jul 24 13:38:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:38:28 2015 +0200

    x86/altp2m: add altp2mhvm HVM domain parameter
    
    The altp2mhvm and nestedhvm parameters are mutually
    exclusive and cannot be set together.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5           |   12 ++++++++++++
 tools/libxl/libxl.h             |    6 ++++++
 tools/libxl/libxl_create.c      |    1 +
 tools/libxl/libxl_dom.c         |    2 ++
 tools/libxl/libxl_types.idl     |    1 +
 tools/libxl/xl_cmdimpl.c        |   10 ++++++++++
 xen/arch/x86/hvm/hvm.c          |   21 ++++++++++++++++++++-
 xen/include/public/hvm/params.h |    5 ++++-
 8 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index ce7ce85..c78c3ba 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1130,6 +1130,18 @@ enabled by default and you should usually omit it. It may be necessary
 to disable the HPET in order to improve compatibility with guest
 Operating Systems (X86 only)
 
+=item B<altp2mhvm=BOOLEAN>
+
+Enables or disables hvm guest access to alternate-p2m capability.
+Alternate-p2m allows a guest to manage multiple p2m guest physical
+"memory views" (as opposed to a single p2m). This option is
+disabled by default and is available only to hvm domains.
+You may want this option if you want to access-control/isolate
+access to specific guest physical memory pages accessed by
+the guest, e.g. for HVM domain memory introspection or
+for isolation/access-control of memory between components within
+a single guest hvm domain.
+
 =item B<nestedhvm=BOOLEAN>
 
 Enable or disables guest access to hardware virtualisation features,
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 927b2d8..5f9047c 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -758,6 +758,12 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_BUILDINFO_SERIAL_LIST 1
 
 /*
+ * LIBXL_HAVE_ALTP2M
+ * If this is defined, then libxl supports alternate p2m functionality.
+ */
+#define LIBXL_HAVE_ALTP2M 1
+
+/*
  * LIBXL_HAVE_REMUS
  * If this is defined, then libxl supports remus.
  */
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index b27c53a..855b42c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -287,6 +287,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
         libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
         libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.altp2m,             false);
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 3f2fec3..b3ae5b5 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -301,6 +301,8 @@ static void hvm_set_conf_params(xc_interface *handle, uint32_t domid,
                     libxl_defbool_val(info->u.hvm.vpt_align));
     xc_hvm_param_set(handle, domid, HVM_PARAM_NESTEDHVM,
                     libxl_defbool_val(info->u.hvm.nested_hvm));
+    xc_hvm_param_set(handle, domid, HVM_PARAM_ALTP2M,
+                    libxl_defbool_val(info->u.hvm.altp2m));
 }
 
 int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9caaf44..ef346e7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -474,6 +474,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("mmio_hole_memkb",  MemKB),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
+                                       ("altp2m",           libxl_defbool),
                                        ("smbios_firmware",  string),
                                        ("acpi_firmware",    string),
                                        ("hdtype",           libxl_hdtype),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index de1c9c0..d0bf0cb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1566,6 +1566,16 @@ static void parse_config_data(const char *config_source,
 
         xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
 
+        xlu_cfg_get_defbool(config, "altp2mhvm", &b_info->u.hvm.altp2m, 0);
+
+        if (!libxl_defbool_is_default(b_info->u.hvm.nested_hvm) &&
+            libxl_defbool_val(b_info->u.hvm.nested_hvm) &&
+            !libxl_defbool_is_default(b_info->u.hvm.altp2m) &&
+            libxl_defbool_val(b_info->u.hvm.altp2m)) {
+            fprintf(stderr, "ERROR: nestedhvm and altp2mhvm cannot be used together\n");
+            exit(1);
+        }
+
         xlu_cfg_replace_string(config, "smbios_firmware",
                                &b_info->u.hvm.smbios_firmware, 0);
         xlu_cfg_replace_string(config, "acpi_firmware",
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index dd70d87..cb05e90 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5866,6 +5866,7 @@ static int hvm_allow_set_param(struct domain *d,
     case HVM_PARAM_VIRIDIAN:
     case HVM_PARAM_IOREQ_SERVER_PFN:
     case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+    case HVM_PARAM_ALTP2M:
         if ( value != 0 && a->value != value )
             rc = -EEXIST;
         break;
@@ -5988,6 +5989,9 @@ static int hvmop_set_param(
          */
         if ( cpu_has_svm && !paging_mode_hap(d) && a.value )
             rc = -EINVAL;
+        if ( a.value &&
+             d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] )
+            rc = -EINVAL;
         /* Set up NHVM state for any vcpus that are already up. */
         if ( a.value &&
              !d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
@@ -5998,6 +6002,13 @@ static int hvmop_set_param(
             for_each_vcpu(d, v)
                 nestedhvm_vcpu_destroy(v);
         break;
+    case HVM_PARAM_ALTP2M:
+        if ( a.value > 1 )
+            rc = -EINVAL;
+        if ( a.value &&
+             d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
+            rc = -EINVAL;
+        break;
     case HVM_PARAM_BUFIOREQ_EVTCHN:
         rc = -EINVAL;
         break;
@@ -6058,6 +6069,7 @@ static int hvm_allow_get_param(struct domain *d,
     case HVM_PARAM_STORE_EVTCHN:
     case HVM_PARAM_CONSOLE_PFN:
     case HVM_PARAM_CONSOLE_EVTCHN:
+    case HVM_PARAM_ALTP2M:
         break;
     /*
      * The following parameters must not be read by the guest
@@ -6178,6 +6190,12 @@ static int do_altp2m_op(
     switch ( a.cmd )
     {
     case HVMOP_altp2m_get_domain_state:
+        if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] )
+        {
+            rc = -EINVAL;
+            break;
+        }
+
         a.u.domain_state.state = altp2m_active(d);
         rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
         break;
@@ -6187,7 +6205,8 @@ static int do_altp2m_op(
         struct vcpu *v;
         bool_t ostate;
 
-        if ( nestedhvm_enabled(d) )
+        if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] ||
+             nestedhvm_enabled(d) )
         {
             rc = -EINVAL;
             break;
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 7c73089..147d9b8 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -187,6 +187,9 @@
 /* Location of the VM Generation ID in guest physical address space. */
 #define HVM_PARAM_VM_GENERATION_ID_ADDR 34
 
-#define HVM_NR_PARAMS          35
+/* Boolean: Enable altp2m */
+#define HVM_PARAM_ALTP2M       35
+
+#define HVM_NR_PARAMS          36
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_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 Fri Jul 31 13:43:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAbA-0006mh-H8; Fri, 31 Jul 2015 13:43: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 1ZLAb9-0006mU-GD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:43 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	47/24-32615-E8B7BB55; Fri, 31 Jul 2015 13:43:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438350221!24967323!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 16455 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAb7-0004aW-09
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAb6-0007LT-Up
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:40 +0000
Date: Fri, 31 Jul 2015 13:43:40 +0000
Message-Id: <E1ZLAb6-0007LT-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: XSM hooks for altp2m HVM
	ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd6b3f20e321866b8460f63afc908492d863b0fe
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Fri Jul 24 13:39:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:39:33 2015 +0200

    x86/altp2m: XSM hooks for altp2m HVM ops
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    
    Drop now bogus conditional expression from xsm_hvm_altp2mhvm_op()
    invocation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/flask/policy/policy/modules/xen/xen.if |    4 ++--
 xen/arch/x86/hvm/hvm.c                       |    6 ++++++
 xen/include/xsm/dummy.h                      |   12 ++++++++++++
 xen/include/xsm/xsm.h                        |   12 ++++++++++++
 xen/xsm/dummy.c                              |    2 ++
 xen/xsm/flask/hooks.c                        |   12 ++++++++++++
 xen/xsm/flask/policy/access_vectors          |    7 +++++++
 7 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index da4c95b..a2f25e1 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -8,7 +8,7 @@
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
 	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
-	allow $1 $2:hvm { getparam setparam };
+	allow $1 $2:hvm { getparam setparam altp2mhvm_op };
 	allow $1 $2:domain2 get_vnumainfo;
 ')
 
@@ -58,7 +58,7 @@ define(`create_domain_common', `
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op updatemp };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc
-			setparam pcilevel trackdirtyvram nested };
+			setparam pcilevel trackdirtyvram nested altp2mhvm altp2mhvm_op };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index cb05e90..ec1d797 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6003,6 +6003,9 @@ static int hvmop_set_param(
                 nestedhvm_vcpu_destroy(v);
         break;
     case HVM_PARAM_ALTP2M:
+        rc = xsm_hvm_param_altp2mhvm(XSM_PRIV, d);
+        if ( rc )
+            break;
         if ( a.value > 1 )
             rc = -EINVAL;
         if ( a.value &&
@@ -6187,6 +6190,9 @@ static int do_altp2m_op(
         goto out;
     }
 
+    if ( (rc = xsm_hvm_altp2mhvm_op(XSM_TARGET, d)) )
+        goto out;
+
     switch ( a.cmd )
     {
     case HVMOP_altp2m_get_domain_state:
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index adb02bc..bbbfce7 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -548,6 +548,18 @@ static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
+static XSM_INLINE int xsm_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
+}
+
 static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 7886574..3678a93 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -147,6 +147,8 @@ struct xsm_operations {
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_control) (struct domain *d, unsigned long op);
     int (*hvm_param_nested) (struct domain *d);
+    int (*hvm_param_altp2mhvm) (struct domain *d);
+    int (*hvm_altp2mhvm_op) (struct domain *d);
     int (*get_vnumainfo) (struct domain *d);
 
     int (*vm_event_control) (struct domain *d, int mode, int op);
@@ -587,6 +589,16 @@ static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
     return xsm_ops->hvm_param_nested(d);
 }
 
+static inline int xsm_hvm_param_altp2mhvm (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_param_altp2mhvm(d);
+}
+
+static inline int xsm_hvm_altp2mhvm_op (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_altp2mhvm_op(d);
+}
+
 static inline int xsm_get_vnumainfo (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->get_vnumainfo(d);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 06ac911..21b1bf8 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -116,6 +116,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_control);
     set_to_dummy_if_null(ops, hvm_param_nested);
+    set_to_dummy_if_null(ops, hvm_param_altp2mhvm);
+    set_to_dummy_if_null(ops, hvm_altp2mhvm_op);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 #ifdef CONFIG_COMPAT
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 882681f..7a4522e 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1176,6 +1176,16 @@ static int flask_hvm_param_nested(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
 }
 
+static int flask_hvm_param_altp2mhvm(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
+}
+
+static int flask_hvm_altp2mhvm_op(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
+}
+
 static int flask_vm_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__VM_EVENT);
@@ -1687,6 +1697,8 @@ static struct xsm_operations flask_ops = {
     .hvm_param = flask_hvm_param,
     .hvm_control = flask_hvm_param,
     .hvm_param_nested = flask_hvm_param_nested,
+    .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
+    .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
 
     .do_xsm_op = do_flask_op,
     .get_vnumainfo = flask_get_vnumainfo,
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index b2a20c3..71495fd 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -282,6 +282,13 @@ class hvm
     share_mem
 # HVMOP_set_param setting HVM_PARAM_NESTEDHVM
     nested
+# HVMOP_set_param setting HVM_PARAM_ALTP2MHVM
+    altp2mhvm
+# HVMOP_altp2m_set_domain_state HVMOP_altp2m_get_domain_state
+# HVMOP_altp2m_vcpu_enable_notify HVMOP_altp2m_create_p2m
+# HVMOP_altp2m_destroy_p2m HVMOP_altp2m_switch_p2m
+# HVMOP_altp2m_set_mem_access HVMOP_altp2m_change_gfn
+    altp2mhvm_op
 }
 
 # Class event describes event channels.  Interdomain event channels have their
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:43:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAbA-0006mh-H8; Fri, 31 Jul 2015 13:43: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 1ZLAb9-0006mU-GD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:43 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	47/24-32615-E8B7BB55; Fri, 31 Jul 2015 13:43:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1438350221!24967323!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 16455 invoked from network); 31 Jul 2015 13:43: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;
	31 Jul 2015 13:43:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAb7-0004aW-09
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAb6-0007LT-Up
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:40 +0000
Date: Fri, 31 Jul 2015 13:43:40 +0000
Message-Id: <E1ZLAb6-0007LT-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/altp2m: XSM hooks for altp2m HVM
	ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd6b3f20e321866b8460f63afc908492d863b0fe
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Fri Jul 24 13:39:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:39:33 2015 +0200

    x86/altp2m: XSM hooks for altp2m HVM ops
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    
    Drop now bogus conditional expression from xsm_hvm_altp2mhvm_op()
    invocation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/flask/policy/policy/modules/xen/xen.if |    4 ++--
 xen/arch/x86/hvm/hvm.c                       |    6 ++++++
 xen/include/xsm/dummy.h                      |   12 ++++++++++++
 xen/include/xsm/xsm.h                        |   12 ++++++++++++
 xen/xsm/dummy.c                              |    2 ++
 xen/xsm/flask/hooks.c                        |   12 ++++++++++++
 xen/xsm/flask/policy/access_vectors          |    7 +++++++
 7 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index da4c95b..a2f25e1 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -8,7 +8,7 @@
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
 	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
-	allow $1 $2:hvm { getparam setparam };
+	allow $1 $2:hvm { getparam setparam altp2mhvm_op };
 	allow $1 $2:domain2 get_vnumainfo;
 ')
 
@@ -58,7 +58,7 @@ define(`create_domain_common', `
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op updatemp };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc
-			setparam pcilevel trackdirtyvram nested };
+			setparam pcilevel trackdirtyvram nested altp2mhvm altp2mhvm_op };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index cb05e90..ec1d797 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6003,6 +6003,9 @@ static int hvmop_set_param(
                 nestedhvm_vcpu_destroy(v);
         break;
     case HVM_PARAM_ALTP2M:
+        rc = xsm_hvm_param_altp2mhvm(XSM_PRIV, d);
+        if ( rc )
+            break;
         if ( a.value > 1 )
             rc = -EINVAL;
         if ( a.value &&
@@ -6187,6 +6190,9 @@ static int do_altp2m_op(
         goto out;
     }
 
+    if ( (rc = xsm_hvm_altp2mhvm_op(XSM_TARGET, d)) )
+        goto out;
+
     switch ( a.cmd )
     {
     case HVMOP_altp2m_get_domain_state:
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index adb02bc..bbbfce7 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -548,6 +548,18 @@ static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
+static XSM_INLINE int xsm_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
+}
+
 static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 7886574..3678a93 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -147,6 +147,8 @@ struct xsm_operations {
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_control) (struct domain *d, unsigned long op);
     int (*hvm_param_nested) (struct domain *d);
+    int (*hvm_param_altp2mhvm) (struct domain *d);
+    int (*hvm_altp2mhvm_op) (struct domain *d);
     int (*get_vnumainfo) (struct domain *d);
 
     int (*vm_event_control) (struct domain *d, int mode, int op);
@@ -587,6 +589,16 @@ static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
     return xsm_ops->hvm_param_nested(d);
 }
 
+static inline int xsm_hvm_param_altp2mhvm (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_param_altp2mhvm(d);
+}
+
+static inline int xsm_hvm_altp2mhvm_op (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_altp2mhvm_op(d);
+}
+
 static inline int xsm_get_vnumainfo (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->get_vnumainfo(d);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 06ac911..21b1bf8 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -116,6 +116,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_control);
     set_to_dummy_if_null(ops, hvm_param_nested);
+    set_to_dummy_if_null(ops, hvm_param_altp2mhvm);
+    set_to_dummy_if_null(ops, hvm_altp2mhvm_op);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 #ifdef CONFIG_COMPAT
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 882681f..7a4522e 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1176,6 +1176,16 @@ static int flask_hvm_param_nested(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
 }
 
+static int flask_hvm_param_altp2mhvm(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
+}
+
+static int flask_hvm_altp2mhvm_op(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
+}
+
 static int flask_vm_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__VM_EVENT);
@@ -1687,6 +1697,8 @@ static struct xsm_operations flask_ops = {
     .hvm_param = flask_hvm_param,
     .hvm_control = flask_hvm_param,
     .hvm_param_nested = flask_hvm_param_nested,
+    .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
+    .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
 
     .do_xsm_op = do_flask_op,
     .get_vnumainfo = flask_get_vnumainfo,
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index b2a20c3..71495fd 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -282,6 +282,13 @@ class hvm
     share_mem
 # HVMOP_set_param setting HVM_PARAM_NESTEDHVM
     nested
+# HVMOP_set_param setting HVM_PARAM_ALTP2MHVM
+    altp2mhvm
+# HVMOP_altp2m_set_domain_state HVMOP_altp2m_get_domain_state
+# HVMOP_altp2m_vcpu_enable_notify HVMOP_altp2m_create_p2m
+# HVMOP_altp2m_destroy_p2m HVMOP_altp2m_switch_p2m
+# HVMOP_altp2m_set_mem_access HVMOP_altp2m_change_gfn
+    altp2mhvm_op
 }
 
 # Class event describes event channels.  Interdomain event channels have their
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:43:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAbL-0006op-KB; Fri, 31 Jul 2015 13:43: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 1ZLAbJ-0006oQ-O6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:53 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	48/94-32615-99B7BB55; Fri, 31 Jul 2015 13:43:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1438350231!19699041!1
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 30304 invoked from network); 31 Jul 2015 13:43:52 -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;
	31 Jul 2015 13:43:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbH-0004aj-5x
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbH-0007Lp-4e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:51 +0000
Date: Fri, 31 Jul 2015 13:43:51 +0000
Message-Id: <E1ZLAbH-0007Lp-4e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add support to altp2m hvmops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a54343af0a6ad9a2f26ee6525663fad0ad28e67
Author:     Tamas K Lengyel <tlengyel@novetta.com>
AuthorDate: Fri Jul 24 13:42:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:42:12 2015 +0200

    libxc: add support to altp2m hvmops
    
    Wrappers to issue altp2m hvmops.
    
    Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile          |    1 +
 tools/libxc/include/xenctrl.h |   22 ++++
 tools/libxc/xc_altp2m.c       |  248 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 271 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 1aec848..b0a3e05 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -10,6 +10,7 @@ override CONFIG_MIGRATE := n
 endif
 
 CTRL_SRCS-y       :=
+CTRL_SRCS-y       += xc_altp2m.c
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 0a98aee..ac7e5fd 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2313,6 +2313,28 @@ void xc_tmem_save_done(xc_interface *xch, int dom);
 int xc_tmem_restore(xc_interface *xch, int dom, int fd);
 int xc_tmem_restore_extra(xc_interface *xch, int dom, int fd);
 
+/**
+ * altp2m operations
+ */
+
+int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state);
+int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state);
+int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
+                                     uint32_t vcpuid, xen_pfn_t gfn);
+int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
+                          xenmem_access_t default_access, uint16_t *view_id);
+int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
+                           uint16_t view_id);
+/* Switch all vCPUs of the domain to the specified altp2m view */
+int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
+                             uint16_t view_id);
+int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
+                             uint16_t view_id, xen_pfn_t gfn,
+                             xenmem_access_t access);
+int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
+                         uint16_t view_id, xen_pfn_t old_gfn,
+                         xen_pfn_t new_gfn);
+
 /** 
  * Mem paging operations.
  * Paging is supported only on the x86 architecture in 64 bit mode, with
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
new file mode 100644
index 0000000..0f3c5ed
--- /dev/null
+++ b/tools/libxc/xc_altp2m.c
@@ -0,0 +1,248 @@
+/******************************************************************************
+ *
+ * xc_altp2m.c
+ *
+ * Interface to altp2m related HVMOPs
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "xc_private.h"
+#include <stdbool.h>
+#include <xen/hvm/hvm_op.h>
+
+int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_get_domain_state;
+    arg->domain = dom;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    if ( !rc )
+        *state = arg->u.domain_state.state;
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_set_domain_state;
+    arg->domain = dom;
+    arg->u.domain_state.state = state;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+/* This is a bit odd to me that it acts on current.. */
+int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
+                                     uint32_t vcpuid, xen_pfn_t gfn)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_vcpu_enable_notify;
+    arg->domain = domid;
+    arg->u.enable_notify.vcpu_id = vcpuid;
+    arg->u.enable_notify.gfn = gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
+                          xenmem_access_t default_access, uint16_t *view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_create_p2m;
+    arg->domain = domid;
+    arg->u.view.view = -1;
+    arg->u.view.hvmmem_default_access = default_access;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    if ( !rc )
+        *view_id = arg->u.view.view;
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
+                           uint16_t view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_destroy_p2m;
+    arg->domain = domid;
+    arg->u.view.view = view_id;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+/* Switch all vCPUs of the domain to the specified altp2m view */
+int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
+                             uint16_t view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_switch_p2m;
+    arg->domain = domid;
+    arg->u.view.view = view_id;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
+                             uint16_t view_id, xen_pfn_t gfn,
+                             xenmem_access_t access)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_set_mem_access;
+    arg->domain = domid;
+    arg->u.set_mem_access.view = view_id;
+    arg->u.set_mem_access.hvmmem_access = access;
+    arg->u.set_mem_access.gfn = gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
+                         uint16_t view_id, xen_pfn_t old_gfn,
+                         xen_pfn_t new_gfn)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_change_gfn;
+    arg->domain = domid;
+    arg->u.change_gfn.view = view_id;
+    arg->u.change_gfn.old_gfn = old_gfn;
+    arg->u.change_gfn.new_gfn = new_gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:43:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:43: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 1ZLAbL-0006op-KB; Fri, 31 Jul 2015 13:43: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 1ZLAbJ-0006oQ-O6
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:53 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	48/94-32615-99B7BB55; Fri, 31 Jul 2015 13:43:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1438350231!19699041!1
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 30304 invoked from network); 31 Jul 2015 13:43:52 -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;
	31 Jul 2015 13:43:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbH-0004aj-5x
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbH-0007Lp-4e
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:43:51 +0000
Date: Fri, 31 Jul 2015 13:43:51 +0000
Message-Id: <E1ZLAbH-0007Lp-4e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add support to altp2m hvmops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a54343af0a6ad9a2f26ee6525663fad0ad28e67
Author:     Tamas K Lengyel <tlengyel@novetta.com>
AuthorDate: Fri Jul 24 13:42:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:42:12 2015 +0200

    libxc: add support to altp2m hvmops
    
    Wrappers to issue altp2m hvmops.
    
    Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile          |    1 +
 tools/libxc/include/xenctrl.h |   22 ++++
 tools/libxc/xc_altp2m.c       |  248 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 271 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 1aec848..b0a3e05 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -10,6 +10,7 @@ override CONFIG_MIGRATE := n
 endif
 
 CTRL_SRCS-y       :=
+CTRL_SRCS-y       += xc_altp2m.c
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 0a98aee..ac7e5fd 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2313,6 +2313,28 @@ void xc_tmem_save_done(xc_interface *xch, int dom);
 int xc_tmem_restore(xc_interface *xch, int dom, int fd);
 int xc_tmem_restore_extra(xc_interface *xch, int dom, int fd);
 
+/**
+ * altp2m operations
+ */
+
+int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state);
+int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state);
+int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
+                                     uint32_t vcpuid, xen_pfn_t gfn);
+int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
+                          xenmem_access_t default_access, uint16_t *view_id);
+int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
+                           uint16_t view_id);
+/* Switch all vCPUs of the domain to the specified altp2m view */
+int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
+                             uint16_t view_id);
+int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
+                             uint16_t view_id, xen_pfn_t gfn,
+                             xenmem_access_t access);
+int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
+                         uint16_t view_id, xen_pfn_t old_gfn,
+                         xen_pfn_t new_gfn);
+
 /** 
  * Mem paging operations.
  * Paging is supported only on the x86 architecture in 64 bit mode, with
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
new file mode 100644
index 0000000..0f3c5ed
--- /dev/null
+++ b/tools/libxc/xc_altp2m.c
@@ -0,0 +1,248 @@
+/******************************************************************************
+ *
+ * xc_altp2m.c
+ *
+ * Interface to altp2m related HVMOPs
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "xc_private.h"
+#include <stdbool.h>
+#include <xen/hvm/hvm_op.h>
+
+int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_get_domain_state;
+    arg->domain = dom;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    if ( !rc )
+        *state = arg->u.domain_state.state;
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_set_domain_state;
+    arg->domain = dom;
+    arg->u.domain_state.state = state;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+/* This is a bit odd to me that it acts on current.. */
+int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
+                                     uint32_t vcpuid, xen_pfn_t gfn)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_vcpu_enable_notify;
+    arg->domain = domid;
+    arg->u.enable_notify.vcpu_id = vcpuid;
+    arg->u.enable_notify.gfn = gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
+                          xenmem_access_t default_access, uint16_t *view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_create_p2m;
+    arg->domain = domid;
+    arg->u.view.view = -1;
+    arg->u.view.hvmmem_default_access = default_access;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    if ( !rc )
+        *view_id = arg->u.view.view;
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
+                           uint16_t view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_destroy_p2m;
+    arg->domain = domid;
+    arg->u.view.view = view_id;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+/* Switch all vCPUs of the domain to the specified altp2m view */
+int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
+                             uint16_t view_id)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_switch_p2m;
+    arg->domain = domid;
+    arg->u.view.view = view_id;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
+                             uint16_t view_id, xen_pfn_t gfn,
+                             xenmem_access_t access)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_set_mem_access;
+    arg->domain = domid;
+    arg->u.set_mem_access.view = view_id;
+    arg->u.set_mem_access.hvmmem_access = access;
+    arg->u.set_mem_access.gfn = gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
+int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
+                         uint16_t view_id, xen_pfn_t old_gfn,
+                         xen_pfn_t new_gfn)
+{
+    int rc;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_altp2m;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
+    arg->cmd = HVMOP_altp2m_change_gfn;
+    arg->domain = domid;
+    arg->u.change_gfn.view = view_id;
+    arg->u.change_gfn.old_gfn = old_gfn;
+    arg->u.change_gfn.new_gfn = new_gfn;
+
+    rc = do_xen_hypercall(handle, &hypercall);
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
+
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:44:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44: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 1ZLAbV-0006rF-Tf; Fri, 31 Jul 2015 13:44:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbU-0006qs-88
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:04 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	6D/E6-25435-3AB7BB55; Fri, 31 Jul 2015 13:44:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438350241!36925357!1
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 19658 invoked from network); 31 Jul 2015 13:44:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:44:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbR-0004bN-Eu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbR-0007MJ-BO
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:01 +0000
Date: Fri, 31 Jul 2015 13:44:01 +0000
Message-Id: <E1ZLAbR-0007MJ-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen-access: altp2m testcases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9875f6d6693a87864f6ab949aedb092f65d15e3a
Author:     Tamas K Lengyel <tlengyel@novetta.com>
AuthorDate: Fri Jul 24 13:42:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:42:24 2015 +0200

    xen-access: altp2m testcases
    
    Working altp2m test-case. Extended the test tool to support singlestepping
    to better highlight the core feature of altp2m view switching.
    
    Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/tests/xen-access/xen-access.c |  173 ++++++++++++++++++++++++++++++-----
 1 files changed, 148 insertions(+), 25 deletions(-)

diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index e6ca9ba..cdb8f4e 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -275,6 +275,19 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     return NULL;
 }
 
+static inline
+int control_singlestep(
+    xc_interface *xch,
+    domid_t domain_id,
+    unsigned long vcpu,
+    bool enable)
+{
+    uint32_t op = enable ?
+        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON : XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
+
+    return xc_domain_debug_control(xch, domain_id, op, vcpu);
+}
+
 /*
  * Note that this function is not thread safe.
  */
@@ -317,13 +330,15 @@ static void put_response(vm_event_t *vm_event, vm_event_response_t *rsp)
 
 void usage(char* progname)
 {
-    fprintf(stderr,
-            "Usage: %s [-m] <domain_id> write|exec|breakpoint\n"
+    fprintf(stderr, "Usage: %s [-m] <domain_id> write|exec", progname);
+#if defined(__i386__) || defined(__x86_64__)
+            fprintf(stderr, "|breakpoint|altp2m_write|altp2m_exec");
+#endif
+            fprintf(stderr,
             "\n"
             "Logs first page writes, execs, or breakpoint traps that occur on the domain.\n"
             "\n"
-            "-m requires this program to run, or else the domain may pause\n",
-            progname);
+            "-m requires this program to run, or else the domain may pause\n");
 }
 
 int main(int argc, char *argv[])
@@ -341,6 +356,8 @@ int main(int argc, char *argv[])
     int required = 0;
     int breakpoint = 0;
     int shutting_down = 0;
+    int altp2m = 0;
+    uint16_t altp2m_view_id = 0;
 
     char* progname = argv[0];
     argv++;
@@ -379,10 +396,22 @@ int main(int argc, char *argv[])
         default_access = XENMEM_access_rw;
         after_first_access = XENMEM_access_rwx;
     }
+#if defined(__i386__) || defined(__x86_64__)
     else if ( !strcmp(argv[0], "breakpoint") )
     {
         breakpoint = 1;
     }
+    else if ( !strcmp(argv[0], "altp2m_write") )
+    {
+        default_access = XENMEM_access_rx;
+        altp2m = 1;
+    }
+    else if ( !strcmp(argv[0], "altp2m_exec") )
+    {
+        default_access = XENMEM_access_rw;
+        altp2m = 1;
+    }
+#endif
     else
     {
         usage(argv[0]);
@@ -415,22 +444,73 @@ int main(int argc, char *argv[])
         goto exit;
     }
 
-    /* Set the default access type and convert all pages to it */
-    rc = xc_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
-    if ( rc < 0 )
+    /* With altp2m we just create a new, restricted view of the memory */
+    if ( altp2m )
     {
-        ERROR("Error %d setting default mem access type\n", rc);
-        goto exit;
-    }
+        xen_pfn_t gfn = 0;
+        unsigned long perm_set = 0;
+
+        rc = xc_altp2m_set_domain_state( xch, domain_id, 1 );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d enabling altp2m on domain!\n", rc);
+            goto exit;
+        }
+
+        rc = xc_altp2m_create_view( xch, domain_id, default_access, &altp2m_view_id );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d creating altp2m view!\n", rc);
+            goto exit;
+        }
 
-    rc = xc_set_mem_access(xch, domain_id, default_access, START_PFN,
-                           (xenaccess->max_gpfn - START_PFN) );
+        DPRINTF("altp2m view created with id %u\n", altp2m_view_id);
+        DPRINTF("Setting altp2m mem_access permissions.. ");
 
-    if ( rc < 0 )
+        for(; gfn < xenaccess->max_gpfn; ++gfn)
+        {
+            rc = xc_altp2m_set_mem_access( xch, domain_id, altp2m_view_id, gfn,
+                                           default_access);
+            if ( !rc )
+                perm_set++;
+        }
+
+        DPRINTF("done! Permissions set on %lu pages.\n", perm_set);
+
+        rc = xc_altp2m_switch_to_view( xch, domain_id, altp2m_view_id );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d switching to altp2m view!\n", rc);
+            goto exit;
+        }
+
+        rc = xc_monitor_singlestep( xch, domain_id, 1 );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d failed to enable singlestep monitoring!\n", rc);
+            goto exit;
+        }
+    }
+
+    if ( !altp2m )
     {
-        ERROR("Error %d setting all memory to access type %d\n", rc,
-              default_access);
-        goto exit;
+        /* Set the default access type and convert all pages to it */
+        rc = xc_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
+        if ( rc < 0 )
+        {
+            ERROR("Error %d setting default mem access type\n", rc);
+            goto exit;
+        }
+
+        rc = xc_set_mem_access(xch, domain_id, default_access, START_PFN,
+                               (xenaccess->max_gpfn - START_PFN) );
+
+        if ( rc < 0 )
+        {
+            ERROR("Error %d setting all memory to access type %d\n", rc,
+                  default_access);
+            goto exit;
+        }
     }
 
     if ( breakpoint )
@@ -448,13 +528,29 @@ int main(int argc, char *argv[])
     {
         if ( interrupted )
         {
+            /* Unregister for every event */
             DPRINTF("xenaccess shutting down on signal %d\n", interrupted);
 
-            /* Unregister for every event */
-            rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, ~0ull, 0);
-            rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, START_PFN,
-                                   (xenaccess->max_gpfn - START_PFN) );
-            rc = xc_monitor_software_breakpoint(xch, domain_id, 0);
+            if ( breakpoint )
+                rc = xc_monitor_software_breakpoint(xch, domain_id, 0);
+
+            if ( altp2m )
+            {
+                uint32_t vcpu_id;
+
+                rc = xc_altp2m_switch_to_view( xch, domain_id, 0 );
+                rc = xc_altp2m_destroy_view(xch, domain_id, altp2m_view_id);
+                rc = xc_altp2m_set_domain_state(xch, domain_id, 0);
+                rc = xc_monitor_singlestep(xch, domain_id, 0);
+
+                for ( vcpu_id = 0; vcpu_id<XEN_LEGACY_MAX_VCPUS; vcpu_id++)
+                    rc = control_singlestep(xch, domain_id, vcpu_id, 0);
+
+            } else {
+                rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, ~0ull, 0);
+                rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, START_PFN,
+                                       (xenaccess->max_gpfn - START_PFN) );
+            }
 
             shutting_down = 1;
         }
@@ -500,7 +596,7 @@ int main(int argc, char *argv[])
                 }
 
                 printf("PAGE ACCESS: %c%c%c for GFN %"PRIx64" (offset %06"
-                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u)\n",
+                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u, altp2m view %u)\n",
                        (req.u.mem_access.flags & MEM_ACCESS_R) ? 'r' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_W) ? 'w' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_X) ? 'x' : '-',
@@ -510,9 +606,20 @@ int main(int argc, char *argv[])
                        (req.u.mem_access.flags & MEM_ACCESS_GLA_VALID) ? 'y' : 'n',
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_IN_GPT) ? 'y' : 'n',
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_WITH_GLA) ? 'y': 'n',
-                       req.vcpu_id);
+                       req.vcpu_id,
+                       req.altp2m_idx);
 
-                if ( default_access != after_first_access )
+                if ( altp2m && req.flags & VM_EVENT_FLAG_ALTERNATE_P2M)
+                {
+                    DPRINTF("\tSwitching back to default view!\n");
+
+                    rsp.reason = req.reason;
+                    rsp.flags = req.flags;
+                    rsp.altp2m_idx = 0;
+
+                    control_singlestep(xch, domain_id, rsp.vcpu_id, 1);
+                }
+                else if ( default_access != after_first_access )
                 {
                     rc = xc_set_mem_access(xch, domain_id, after_first_access,
                                            req.u.mem_access.gfn, 1);
@@ -525,7 +632,6 @@ int main(int argc, char *argv[])
                     }
                 }
 
-
                 rsp.u.mem_access.gfn = req.u.mem_access.gfn;
                 break;
             case VM_EVENT_REASON_SOFTWARE_BREAKPOINT:
@@ -546,6 +652,23 @@ int main(int argc, char *argv[])
                 }
 
                 break;
+            case VM_EVENT_REASON_SINGLESTEP:
+                printf("Singlestep: rip=%016"PRIx64", vcpu %d\n",
+                       req.data.regs.x86.rip,
+                       req.vcpu_id);
+
+                if ( altp2m )
+                {
+                    printf("\tSwitching altp2m to view %u!\n", altp2m_view_id);
+
+                    rsp.reason = req.reason;
+                    rsp.flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+                    rsp.altp2m_idx = altp2m_view_id;
+                }
+
+                control_singlestep(xch, domain_id, req.vcpu_id, 0);
+
+                break;
             default:
                 fprintf(stderr, "UNKNOWN REASON CODE %d\n", req.reason);
             }
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44: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 1ZLAbV-0006rF-Tf; Fri, 31 Jul 2015 13:44:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbU-0006qs-88
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:04 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	6D/E6-25435-3AB7BB55; Fri, 31 Jul 2015 13:44:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438350241!36925357!1
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 19658 invoked from network); 31 Jul 2015 13:44:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:44:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbR-0004bN-Eu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbR-0007MJ-BO
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:01 +0000
Date: Fri, 31 Jul 2015 13:44:01 +0000
Message-Id: <E1ZLAbR-0007MJ-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen-access: altp2m testcases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9875f6d6693a87864f6ab949aedb092f65d15e3a
Author:     Tamas K Lengyel <tlengyel@novetta.com>
AuthorDate: Fri Jul 24 13:42:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 24 13:42:24 2015 +0200

    xen-access: altp2m testcases
    
    Working altp2m test-case. Extended the test tool to support singlestepping
    to better highlight the core feature of altp2m view switching.
    
    Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/tests/xen-access/xen-access.c |  173 ++++++++++++++++++++++++++++++-----
 1 files changed, 148 insertions(+), 25 deletions(-)

diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index e6ca9ba..cdb8f4e 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -275,6 +275,19 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     return NULL;
 }
 
+static inline
+int control_singlestep(
+    xc_interface *xch,
+    domid_t domain_id,
+    unsigned long vcpu,
+    bool enable)
+{
+    uint32_t op = enable ?
+        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON : XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
+
+    return xc_domain_debug_control(xch, domain_id, op, vcpu);
+}
+
 /*
  * Note that this function is not thread safe.
  */
@@ -317,13 +330,15 @@ static void put_response(vm_event_t *vm_event, vm_event_response_t *rsp)
 
 void usage(char* progname)
 {
-    fprintf(stderr,
-            "Usage: %s [-m] <domain_id> write|exec|breakpoint\n"
+    fprintf(stderr, "Usage: %s [-m] <domain_id> write|exec", progname);
+#if defined(__i386__) || defined(__x86_64__)
+            fprintf(stderr, "|breakpoint|altp2m_write|altp2m_exec");
+#endif
+            fprintf(stderr,
             "\n"
             "Logs first page writes, execs, or breakpoint traps that occur on the domain.\n"
             "\n"
-            "-m requires this program to run, or else the domain may pause\n",
-            progname);
+            "-m requires this program to run, or else the domain may pause\n");
 }
 
 int main(int argc, char *argv[])
@@ -341,6 +356,8 @@ int main(int argc, char *argv[])
     int required = 0;
     int breakpoint = 0;
     int shutting_down = 0;
+    int altp2m = 0;
+    uint16_t altp2m_view_id = 0;
 
     char* progname = argv[0];
     argv++;
@@ -379,10 +396,22 @@ int main(int argc, char *argv[])
         default_access = XENMEM_access_rw;
         after_first_access = XENMEM_access_rwx;
     }
+#if defined(__i386__) || defined(__x86_64__)
     else if ( !strcmp(argv[0], "breakpoint") )
     {
         breakpoint = 1;
     }
+    else if ( !strcmp(argv[0], "altp2m_write") )
+    {
+        default_access = XENMEM_access_rx;
+        altp2m = 1;
+    }
+    else if ( !strcmp(argv[0], "altp2m_exec") )
+    {
+        default_access = XENMEM_access_rw;
+        altp2m = 1;
+    }
+#endif
     else
     {
         usage(argv[0]);
@@ -415,22 +444,73 @@ int main(int argc, char *argv[])
         goto exit;
     }
 
-    /* Set the default access type and convert all pages to it */
-    rc = xc_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
-    if ( rc < 0 )
+    /* With altp2m we just create a new, restricted view of the memory */
+    if ( altp2m )
     {
-        ERROR("Error %d setting default mem access type\n", rc);
-        goto exit;
-    }
+        xen_pfn_t gfn = 0;
+        unsigned long perm_set = 0;
+
+        rc = xc_altp2m_set_domain_state( xch, domain_id, 1 );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d enabling altp2m on domain!\n", rc);
+            goto exit;
+        }
+
+        rc = xc_altp2m_create_view( xch, domain_id, default_access, &altp2m_view_id );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d creating altp2m view!\n", rc);
+            goto exit;
+        }
 
-    rc = xc_set_mem_access(xch, domain_id, default_access, START_PFN,
-                           (xenaccess->max_gpfn - START_PFN) );
+        DPRINTF("altp2m view created with id %u\n", altp2m_view_id);
+        DPRINTF("Setting altp2m mem_access permissions.. ");
 
-    if ( rc < 0 )
+        for(; gfn < xenaccess->max_gpfn; ++gfn)
+        {
+            rc = xc_altp2m_set_mem_access( xch, domain_id, altp2m_view_id, gfn,
+                                           default_access);
+            if ( !rc )
+                perm_set++;
+        }
+
+        DPRINTF("done! Permissions set on %lu pages.\n", perm_set);
+
+        rc = xc_altp2m_switch_to_view( xch, domain_id, altp2m_view_id );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d switching to altp2m view!\n", rc);
+            goto exit;
+        }
+
+        rc = xc_monitor_singlestep( xch, domain_id, 1 );
+        if ( rc < 0 )
+        {
+            ERROR("Error %d failed to enable singlestep monitoring!\n", rc);
+            goto exit;
+        }
+    }
+
+    if ( !altp2m )
     {
-        ERROR("Error %d setting all memory to access type %d\n", rc,
-              default_access);
-        goto exit;
+        /* Set the default access type and convert all pages to it */
+        rc = xc_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
+        if ( rc < 0 )
+        {
+            ERROR("Error %d setting default mem access type\n", rc);
+            goto exit;
+        }
+
+        rc = xc_set_mem_access(xch, domain_id, default_access, START_PFN,
+                               (xenaccess->max_gpfn - START_PFN) );
+
+        if ( rc < 0 )
+        {
+            ERROR("Error %d setting all memory to access type %d\n", rc,
+                  default_access);
+            goto exit;
+        }
     }
 
     if ( breakpoint )
@@ -448,13 +528,29 @@ int main(int argc, char *argv[])
     {
         if ( interrupted )
         {
+            /* Unregister for every event */
             DPRINTF("xenaccess shutting down on signal %d\n", interrupted);
 
-            /* Unregister for every event */
-            rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, ~0ull, 0);
-            rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, START_PFN,
-                                   (xenaccess->max_gpfn - START_PFN) );
-            rc = xc_monitor_software_breakpoint(xch, domain_id, 0);
+            if ( breakpoint )
+                rc = xc_monitor_software_breakpoint(xch, domain_id, 0);
+
+            if ( altp2m )
+            {
+                uint32_t vcpu_id;
+
+                rc = xc_altp2m_switch_to_view( xch, domain_id, 0 );
+                rc = xc_altp2m_destroy_view(xch, domain_id, altp2m_view_id);
+                rc = xc_altp2m_set_domain_state(xch, domain_id, 0);
+                rc = xc_monitor_singlestep(xch, domain_id, 0);
+
+                for ( vcpu_id = 0; vcpu_id<XEN_LEGACY_MAX_VCPUS; vcpu_id++)
+                    rc = control_singlestep(xch, domain_id, vcpu_id, 0);
+
+            } else {
+                rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, ~0ull, 0);
+                rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, START_PFN,
+                                       (xenaccess->max_gpfn - START_PFN) );
+            }
 
             shutting_down = 1;
         }
@@ -500,7 +596,7 @@ int main(int argc, char *argv[])
                 }
 
                 printf("PAGE ACCESS: %c%c%c for GFN %"PRIx64" (offset %06"
-                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u)\n",
+                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u, altp2m view %u)\n",
                        (req.u.mem_access.flags & MEM_ACCESS_R) ? 'r' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_W) ? 'w' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_X) ? 'x' : '-',
@@ -510,9 +606,20 @@ int main(int argc, char *argv[])
                        (req.u.mem_access.flags & MEM_ACCESS_GLA_VALID) ? 'y' : 'n',
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_IN_GPT) ? 'y' : 'n',
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_WITH_GLA) ? 'y': 'n',
-                       req.vcpu_id);
+                       req.vcpu_id,
+                       req.altp2m_idx);
 
-                if ( default_access != after_first_access )
+                if ( altp2m && req.flags & VM_EVENT_FLAG_ALTERNATE_P2M)
+                {
+                    DPRINTF("\tSwitching back to default view!\n");
+
+                    rsp.reason = req.reason;
+                    rsp.flags = req.flags;
+                    rsp.altp2m_idx = 0;
+
+                    control_singlestep(xch, domain_id, rsp.vcpu_id, 1);
+                }
+                else if ( default_access != after_first_access )
                 {
                     rc = xc_set_mem_access(xch, domain_id, after_first_access,
                                            req.u.mem_access.gfn, 1);
@@ -525,7 +632,6 @@ int main(int argc, char *argv[])
                     }
                 }
 
-
                 rsp.u.mem_access.gfn = req.u.mem_access.gfn;
                 break;
             case VM_EVENT_REASON_SOFTWARE_BREAKPOINT:
@@ -546,6 +652,23 @@ int main(int argc, char *argv[])
                 }
 
                 break;
+            case VM_EVENT_REASON_SINGLESTEP:
+                printf("Singlestep: rip=%016"PRIx64", vcpu %d\n",
+                       req.data.regs.x86.rip,
+                       req.vcpu_id);
+
+                if ( altp2m )
+                {
+                    printf("\tSwitching altp2m to view %u!\n", altp2m_view_id);
+
+                    rsp.reason = req.reason;
+                    rsp.flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+                    rsp.altp2m_idx = altp2m_view_id;
+                }
+
+                control_singlestep(xch, domain_id, req.vcpu_id, 0);
+
+                break;
             default:
                 fprintf(stderr, "UNKNOWN REASON CODE %d\n", req.reason);
             }
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbg-0006tF-0C; Fri, 31 Jul 2015 13:44: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 1ZLAbe-0006t0-3b
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:14 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	22/4B-09570-DAB7BB55; Fri, 31 Jul 2015 13:44:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438350251!31148504!1
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 18139 invoked from network); 31 Jul 2015 13:44:12 -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;
	31 Jul 2015 13:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbb-0004bZ-LZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbb-0007NQ-Kd
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:11 +0000
Date: Fri, 31 Jul 2015 13:44:11 +0000
Message-Id: <E1ZLAbb-0007NQ-Kd@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 19b17e240c5f31eb1ff744946ce75afa729bfe91
Merge: 9072240954fc8a7c74ae04d2eb51c98bc0cb3356 9875f6d6693a87864f6ab949aedb092f65d15e3a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 24 14:13:21 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 14:13:21 2015 +0100

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

 docs/man/xl.cfg.pod.5                        |   12 +
 docs/misc/xen-command-line.markdown          |    7 +
 tools/flask/policy/policy/modules/xen/xen.if |    4 +-
 tools/libxc/Makefile                         |    1 +
 tools/libxc/include/xenctrl.h                |   22 +
 tools/libxc/xc_altp2m.c                      |  248 +++++++++++
 tools/libxl/libxl.h                          |    6 +
 tools/libxl/libxl_create.c                   |    1 +
 tools/libxl/libxl_dom.c                      |    2 +
 tools/libxl/libxl_types.idl                  |    1 +
 tools/libxl/xl_cmdimpl.c                     |   10 +
 tools/tests/xen-access/xen-access.c          |  173 +++++++-
 xen/arch/x86/hvm/emulate.c                   |   18 +-
 xen/arch/x86/hvm/hvm.c                       |  252 +++++++++++-
 xen/arch/x86/hvm/vmx/vmcs.c                  |   42 ++-
 xen/arch/x86/hvm/vmx/vmx.c                   |  176 ++++++++
 xen/arch/x86/mm/Makefile                     |    1 +
 xen/arch/x86/mm/altp2m.c                     |   77 ++++
 xen/arch/x86/mm/hap/hap.c                    |   40 ++-
 xen/arch/x86/mm/mem_sharing.c                |    4 +-
 xen/arch/x86/mm/mm-locks.h                   |   46 ++-
 xen/arch/x86/mm/p2m-ept.c                    |   35 ++-
 xen/arch/x86/mm/p2m-pod.c                    |   12 +-
 xen/arch/x86/mm/p2m-pt.c                     |   10 +-
 xen/arch/x86/mm/p2m.c                        |  608 ++++++++++++++++++++++++--
 xen/arch/x86/x86_emulate/x86_emulate.c       |   19 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |    4 +
 xen/common/domain.c                          |   28 ++
 xen/common/vm_event.c                        |    4 +
 xen/include/asm-arm/p2m.h                    |    6 +
 xen/include/asm-x86/altp2m.h                 |   38 ++
 xen/include/asm-x86/domain.h                 |   10 +
 xen/include/asm-x86/hvm/hvm.h                |   25 +
 xen/include/asm-x86/hvm/vcpu.h               |    9 +
 xen/include/asm-x86/hvm/vmx/vmcs.h           |   14 +-
 xen/include/asm-x86/hvm/vmx/vmx.h            |   13 +-
 xen/include/asm-x86/msr-index.h              |    1 +
 xen/include/asm-x86/p2m.h                    |  100 ++++-
 xen/include/public/hvm/hvm_op.h              |   89 ++++
 xen/include/public/hvm/params.h              |    5 +-
 xen/include/public/vm_event.h                |   12 +
 xen/include/xen/sched.h                      |    5 +
 xen/include/xsm/dummy.h                      |   12 +
 xen/include/xsm/xsm.h                        |   12 +
 xen/xsm/dummy.c                              |    2 +
 xen/xsm/flask/hooks.c                        |   12 +
 xen/xsm/flask/policy/access_vectors          |    7 +
 47 files changed, 2131 insertions(+), 104 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 Jul 31 13:44:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbg-0006tF-0C; Fri, 31 Jul 2015 13:44: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 1ZLAbe-0006t0-3b
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:14 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	22/4B-09570-DAB7BB55; Fri, 31 Jul 2015 13:44:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1438350251!31148504!1
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 18139 invoked from network); 31 Jul 2015 13:44:12 -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;
	31 Jul 2015 13:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbb-0004bZ-LZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbb-0007NQ-Kd
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:11 +0000
Date: Fri, 31 Jul 2015 13:44:11 +0000
Message-Id: <E1ZLAbb-0007NQ-Kd@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 19b17e240c5f31eb1ff744946ce75afa729bfe91
Merge: 9072240954fc8a7c74ae04d2eb51c98bc0cb3356 9875f6d6693a87864f6ab949aedb092f65d15e3a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jul 24 14:13:21 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jul 24 14:13:21 2015 +0100

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

 docs/man/xl.cfg.pod.5                        |   12 +
 docs/misc/xen-command-line.markdown          |    7 +
 tools/flask/policy/policy/modules/xen/xen.if |    4 +-
 tools/libxc/Makefile                         |    1 +
 tools/libxc/include/xenctrl.h                |   22 +
 tools/libxc/xc_altp2m.c                      |  248 +++++++++++
 tools/libxl/libxl.h                          |    6 +
 tools/libxl/libxl_create.c                   |    1 +
 tools/libxl/libxl_dom.c                      |    2 +
 tools/libxl/libxl_types.idl                  |    1 +
 tools/libxl/xl_cmdimpl.c                     |   10 +
 tools/tests/xen-access/xen-access.c          |  173 +++++++-
 xen/arch/x86/hvm/emulate.c                   |   18 +-
 xen/arch/x86/hvm/hvm.c                       |  252 +++++++++++-
 xen/arch/x86/hvm/vmx/vmcs.c                  |   42 ++-
 xen/arch/x86/hvm/vmx/vmx.c                   |  176 ++++++++
 xen/arch/x86/mm/Makefile                     |    1 +
 xen/arch/x86/mm/altp2m.c                     |   77 ++++
 xen/arch/x86/mm/hap/hap.c                    |   40 ++-
 xen/arch/x86/mm/mem_sharing.c                |    4 +-
 xen/arch/x86/mm/mm-locks.h                   |   46 ++-
 xen/arch/x86/mm/p2m-ept.c                    |   35 ++-
 xen/arch/x86/mm/p2m-pod.c                    |   12 +-
 xen/arch/x86/mm/p2m-pt.c                     |   10 +-
 xen/arch/x86/mm/p2m.c                        |  608 ++++++++++++++++++++++++--
 xen/arch/x86/x86_emulate/x86_emulate.c       |   19 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |    4 +
 xen/common/domain.c                          |   28 ++
 xen/common/vm_event.c                        |    4 +
 xen/include/asm-arm/p2m.h                    |    6 +
 xen/include/asm-x86/altp2m.h                 |   38 ++
 xen/include/asm-x86/domain.h                 |   10 +
 xen/include/asm-x86/hvm/hvm.h                |   25 +
 xen/include/asm-x86/hvm/vcpu.h               |    9 +
 xen/include/asm-x86/hvm/vmx/vmcs.h           |   14 +-
 xen/include/asm-x86/hvm/vmx/vmx.h            |   13 +-
 xen/include/asm-x86/msr-index.h              |    1 +
 xen/include/asm-x86/p2m.h                    |  100 ++++-
 xen/include/public/hvm/hvm_op.h              |   89 ++++
 xen/include/public/hvm/params.h              |    5 +-
 xen/include/public/vm_event.h                |   12 +
 xen/include/xen/sched.h                      |    5 +
 xen/include/xsm/dummy.h                      |   12 +
 xen/include/xsm/xsm.h                        |   12 +
 xen/xsm/dummy.c                              |    2 +
 xen/xsm/flask/hooks.c                        |   12 +
 xen/xsm/flask/policy/access_vectors          |    7 +
 47 files changed, 2131 insertions(+), 104 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 Jul 31 13:44:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbq-0006vP-3G; Fri, 31 Jul 2015 13:44:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbo-0006uz-3K
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:24 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	78/AE-22089-7BB7BB55; Fri, 31 Jul 2015 13:44:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438350262!9260961!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 23981 invoked from network); 31 Jul 2015 13:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:44:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbl-0004bh-Ub
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 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 1ZLAbl-0007Nn-Pg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:21 +0000
Date: Fri, 31 Jul 2015 13:44:21 +0000
Message-Id: <E1ZLAbl-0007Nn-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix memory leak in migration v2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 20960a081ad23e0a5d1fd48fd84cff9f81e7cc6c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Jul 26 22:34:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jul 27 08:55:00 2015 +0100

    libxc: fix memory leak in migration v2
    
    Originally there was only one counter to keep track of pages. It was
    used erroneously to keep track of how many pages were mapped and how
    many pages needed to be sent. In the end munmap(2) always had 0 as the
    length argument, which resulted in leaking the mapping.
    
    This problem was discovered on 32bit toolstack because 32bit applications
    have notably smaller address space. In fact this bug affects 64bit
    toolstack too.
    
    Use a separate counter to keep track of the number of mapped pages to
    solve this problem.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_save.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index d63b783..1b6be2a 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -84,7 +84,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void **guest_data = NULL;
     void **local_pages = NULL;
     int *errors = NULL, rc = -1;
-    unsigned i, p, nr_pages = 0;
+    unsigned i, p, nr_pages = 0, nr_pages_mapped = 0;
     unsigned nr_pfns = ctx->save.nr_batch_pfns;
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
@@ -160,6 +160,7 @@ static int write_batch(struct xc_sr_context *ctx)
             PERROR("Failed to map guest pages");
             goto err;
         }
+        nr_pages_mapped = nr_pages;
 
         for ( i = 0, p = 0; i < nr_pfns; ++i )
         {
@@ -262,7 +263,7 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     free(rec_pfns);
     if ( guest_mapping )
-        munmap(guest_mapping, nr_pages * PAGE_SIZE);
+        munmap(guest_mapping, nr_pages_mapped * PAGE_SIZE);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
         free(local_pages[i]);
     free(iov);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbq-0006vP-3G; Fri, 31 Jul 2015 13:44:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbo-0006uz-3K
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:24 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	78/AE-22089-7BB7BB55; Fri, 31 Jul 2015 13:44:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1438350262!9260961!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 23981 invoked from network); 31 Jul 2015 13:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:44:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbl-0004bh-Ub
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 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 1ZLAbl-0007Nn-Pg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:21 +0000
Date: Fri, 31 Jul 2015 13:44:21 +0000
Message-Id: <E1ZLAbl-0007Nn-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix memory leak in migration v2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 20960a081ad23e0a5d1fd48fd84cff9f81e7cc6c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Jul 26 22:34:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jul 27 08:55:00 2015 +0100

    libxc: fix memory leak in migration v2
    
    Originally there was only one counter to keep track of pages. It was
    used erroneously to keep track of how many pages were mapped and how
    many pages needed to be sent. In the end munmap(2) always had 0 as the
    length argument, which resulted in leaking the mapping.
    
    This problem was discovered on 32bit toolstack because 32bit applications
    have notably smaller address space. In fact this bug affects 64bit
    toolstack too.
    
    Use a separate counter to keep track of the number of mapped pages to
    solve this problem.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_save.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index d63b783..1b6be2a 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -84,7 +84,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void **guest_data = NULL;
     void **local_pages = NULL;
     int *errors = NULL, rc = -1;
-    unsigned i, p, nr_pages = 0;
+    unsigned i, p, nr_pages = 0, nr_pages_mapped = 0;
     unsigned nr_pfns = ctx->save.nr_batch_pfns;
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
@@ -160,6 +160,7 @@ static int write_batch(struct xc_sr_context *ctx)
             PERROR("Failed to map guest pages");
             goto err;
         }
+        nr_pages_mapped = nr_pages;
 
         for ( i = 0, p = 0; i < nr_pfns; ++i )
         {
@@ -262,7 +263,7 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     free(rec_pfns);
     if ( guest_mapping )
-        munmap(guest_mapping, nr_pages * PAGE_SIZE);
+        munmap(guest_mapping, nr_pages_mapped * PAGE_SIZE);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
         free(local_pages[i]);
     free(iov);
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbz-0006xH-5n; Fri, 31 Jul 2015 13:44: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 1ZLAby-0006x2-LD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:34 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	B5/88-03763-1CB7BB55; Fri, 31 Jul 2015 13:44:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1438350272!28698634!1
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 26470 invoked from network); 31 Jul 2015 13:44:33 -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;
	31 Jul 2015 13:44:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbw-0004bp-7A
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbw-0007Ot-2S
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:32 +0000
Date: Fri, 31 Jul 2015 13:44:32 +0000
Message-Id: <E1ZLAbw-0007Ot-2S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: Ensure exclusive access to
	console using locks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8398ec706ff60e17a5044470fa2e90a1b081f37a
Author:     Martin Lucina <martin@lucina.net>
AuthorDate: Fri Jul 24 17:29:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jul 27 14:54:55 2015 +0100

    xenconsole: Ensure exclusive access to console using locks
    
    If more than one instance of xenconsole is run against the same DOMID
    then each instance will only get some data. This change ensures
    exclusive access to the console by obtaining an exclusive lock on
    <XEN_LOCK_DIR>/xenconsole.<DOMID>.
    
    The locking strategy used is based on
    tools/libxl/libxl_internal.c:libxl__lock_domain_userdata().
    
    Signed-off-by: Martin Lucina <martin@lucina.net>
    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 Jackson <ian.jackson@eu.citrix.com>
---
 .gitignore                  |    1 +
 tools/console/Makefile      |    6 ++++-
 tools/console/client/main.c |   55 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index f6ddb00..bccbd12 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,6 +100,7 @@ tools/blktap2/vhd/vhd-update
 tools/blktap2/vhd/vhd-util
 tools/console/xenconsole
 tools/console/xenconsoled
+tools/console/client/_paths.h
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
 tools/debugger/gdb/gdb-6.2.1/*
 tools/debugger/gdb/gdb-6.2.1.tar.bz2
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 71f8088..77e8f29 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -21,6 +21,7 @@ all: $(BIN)
 clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
 	$(RM) client/*.o daemon/*.o
+	$(RM) client/_paths.h
 
 .PHONY: distclean
 distclean: clean
@@ -28,9 +29,12 @@ distclean: clean
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
-xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
+xenconsole: client/_paths.h $(patsubst %.c,%.o,$(wildcard client/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
 
+genpath-target = $(call buildmakevars2header,client/_paths.h)
+$(eval $(genpath-target))
+
 .PHONY: install
 install: $(BIN)
 	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 753b3aa..ff9ac7d 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -18,7 +18,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 \*/
 
+#include <sys/file.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <stdio.h>
@@ -40,10 +42,13 @@
 
 #include <xenstore.h>
 #include "xenctrl.h"
+#include "_paths.h"
 
 #define ESCAPE_CHARACTER 0x1d
 
 static volatile sig_atomic_t received_signal = 0;
+static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
+static int lockfd = -1;
 
 static void sighandler(int signum)
 {
@@ -267,6 +272,53 @@ static void restore_term_stdin(void)
 	restore_term(STDIN_FILENO, &stdin_old_attr);
 }
 
+/* The following locking strategy is based on that from
+ * libxl__domain_userdata_lock(), with the difference that we want to fail if we
+ * cannot acquire the lock rather than wait indefinitely.
+ */
+static void console_lock(int domid)
+{
+	struct stat stab, fstab;
+	int fd;
+
+	snprintf(lockfile, sizeof lockfile, "%s%d", XEN_LOCK_DIR "/xenconsole.", domid);
+
+	while (true) {
+		fd = open(lockfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+		if (fd < 0)
+			err(errno, "Could not open %s", lockfile);
+
+		while (flock(fd, LOCK_EX | LOCK_NB)) {
+			if (errno == EINTR)
+				continue;
+			else
+				err(errno, "Could not lock %s", lockfile);
+		}
+		if (fstat(fd, &fstab))
+			err(errno, "Could not fstat %s", lockfile);
+		if (stat(lockfile, &stab)) {
+			if (errno != ENOENT)
+				err(errno, "Could not stat %s", lockfile);
+		} else {
+			if (stab.st_dev == fstab.st_dev && stab.st_ino == fstab.st_ino)
+				break;
+		}
+
+		close(fd);
+	}
+
+	lockfd = fd;
+	return;
+}
+
+static void console_unlock(void)
+{
+	if (lockfile[0] && lockfd != -1) {
+		unlink(lockfile);
+		close(lockfd);
+	}
+}
+
 int main(int argc, char **argv)
 {
 	struct termios attr;
@@ -382,6 +434,9 @@ int main(int argc, char **argv)
 		exit(EINVAL);
 	}
 
+	console_lock(domid);
+	atexit(console_unlock);
+
 	/* Set a watch on this domain's console pty */
 	if (!xs_watch(xs, path, ""))
 		err(errno, "Can't set watch for console pty");
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAbz-0006xH-5n; Fri, 31 Jul 2015 13:44: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 1ZLAby-0006x2-LD
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:34 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	B5/88-03763-1CB7BB55; Fri, 31 Jul 2015 13:44:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1438350272!28698634!1
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 26470 invoked from network); 31 Jul 2015 13:44:33 -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;
	31 Jul 2015 13:44:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbw-0004bp-7A
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAbw-0007Ot-2S
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:32 +0000
Date: Fri, 31 Jul 2015 13:44:32 +0000
Message-Id: <E1ZLAbw-0007Ot-2S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: Ensure exclusive access to
	console using locks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8398ec706ff60e17a5044470fa2e90a1b081f37a
Author:     Martin Lucina <martin@lucina.net>
AuthorDate: Fri Jul 24 17:29:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jul 27 14:54:55 2015 +0100

    xenconsole: Ensure exclusive access to console using locks
    
    If more than one instance of xenconsole is run against the same DOMID
    then each instance will only get some data. This change ensures
    exclusive access to the console by obtaining an exclusive lock on
    <XEN_LOCK_DIR>/xenconsole.<DOMID>.
    
    The locking strategy used is based on
    tools/libxl/libxl_internal.c:libxl__lock_domain_userdata().
    
    Signed-off-by: Martin Lucina <martin@lucina.net>
    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 Jackson <ian.jackson@eu.citrix.com>
---
 .gitignore                  |    1 +
 tools/console/Makefile      |    6 ++++-
 tools/console/client/main.c |   55 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index f6ddb00..bccbd12 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,6 +100,7 @@ tools/blktap2/vhd/vhd-update
 tools/blktap2/vhd/vhd-util
 tools/console/xenconsole
 tools/console/xenconsoled
+tools/console/client/_paths.h
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
 tools/debugger/gdb/gdb-6.2.1/*
 tools/debugger/gdb/gdb-6.2.1.tar.bz2
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 71f8088..77e8f29 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -21,6 +21,7 @@ all: $(BIN)
 clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
 	$(RM) client/*.o daemon/*.o
+	$(RM) client/_paths.h
 
 .PHONY: distclean
 distclean: clean
@@ -28,9 +29,12 @@ distclean: clean
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
-xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
+xenconsole: client/_paths.h $(patsubst %.c,%.o,$(wildcard client/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
 
+genpath-target = $(call buildmakevars2header,client/_paths.h)
+$(eval $(genpath-target))
+
 .PHONY: install
 install: $(BIN)
 	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 753b3aa..ff9ac7d 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -18,7 +18,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 \*/
 
+#include <sys/file.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <stdio.h>
@@ -40,10 +42,13 @@
 
 #include <xenstore.h>
 #include "xenctrl.h"
+#include "_paths.h"
 
 #define ESCAPE_CHARACTER 0x1d
 
 static volatile sig_atomic_t received_signal = 0;
+static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
+static int lockfd = -1;
 
 static void sighandler(int signum)
 {
@@ -267,6 +272,53 @@ static void restore_term_stdin(void)
 	restore_term(STDIN_FILENO, &stdin_old_attr);
 }
 
+/* The following locking strategy is based on that from
+ * libxl__domain_userdata_lock(), with the difference that we want to fail if we
+ * cannot acquire the lock rather than wait indefinitely.
+ */
+static void console_lock(int domid)
+{
+	struct stat stab, fstab;
+	int fd;
+
+	snprintf(lockfile, sizeof lockfile, "%s%d", XEN_LOCK_DIR "/xenconsole.", domid);
+
+	while (true) {
+		fd = open(lockfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+		if (fd < 0)
+			err(errno, "Could not open %s", lockfile);
+
+		while (flock(fd, LOCK_EX | LOCK_NB)) {
+			if (errno == EINTR)
+				continue;
+			else
+				err(errno, "Could not lock %s", lockfile);
+		}
+		if (fstat(fd, &fstab))
+			err(errno, "Could not fstat %s", lockfile);
+		if (stat(lockfile, &stab)) {
+			if (errno != ENOENT)
+				err(errno, "Could not stat %s", lockfile);
+		} else {
+			if (stab.st_dev == fstab.st_dev && stab.st_ino == fstab.st_ino)
+				break;
+		}
+
+		close(fd);
+	}
+
+	lockfd = fd;
+	return;
+}
+
+static void console_unlock(void)
+{
+	if (lockfile[0] && lockfd != -1) {
+		unlink(lockfile);
+		close(lockfd);
+	}
+}
+
 int main(int argc, char **argv)
 {
 	struct termios attr;
@@ -382,6 +434,9 @@ int main(int argc, char **argv)
 		exit(EINVAL);
 	}
 
+	console_lock(domid);
+	atexit(console_unlock);
+
 	/* Set a watch on this domain's console pty */
 	if (!xs_watch(xs, path, ""))
 		err(errno, "Can't set watch for console pty");
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44: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 1ZLAc9-0006zC-8Q; Fri, 31 Jul 2015 13:44: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 1ZLAc8-0006yy-Hr
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:44 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	94/33-01753-BCB7BB55; Fri, 31 Jul 2015 13:44:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1438350282!31189417!1
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 1906 invoked from network); 31 Jul 2015 13:44:43 -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;
	31 Jul 2015 13:44:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAc6-0004bx-Cc
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAc6-0007PG-BZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:42 +0000
Date: Fri, 31 Jul 2015 13:44:42 +0000
Message-Id: <E1ZLAc6-0007PG-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: check nesthvm and altp2m in
	libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9041b4eeb792fa0ef42828d2d49c22484f2e363
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 15:01:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:04:12 2015 +0100

    libxl: check nesthvm and altp2m in libxl
    
    In ea214001 ("x86/altp2m: add altp2mhvm HVM domain parameter"), a
    check was added to ensure nestedhvm and altp2m cannot be enabled at
    the same time. That check was added in xl, but in fact it should be in
    libxl because it should be the entity that decides whether
    the provided configuration is valid.
    
    This patch moves the check to libxl. The code snippet is moved after
    calling libxl__domain_build_info_setdefault so that we can:
    1. remove libxl_defbool_is_default in `if()';
    2. detect mistake in libxl__domain_build_info_setdefault.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    7 +++++++
 tools/libxl/xl_cmdimpl.c   |    8 --------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 855b42c..0294844 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -883,6 +883,13 @@ static void initiate_domain_create(libxl__egc *egc,
         goto error_out;
     }
 
+    if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
+        (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) &&
+         libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) {
+        LOG(ERROR, "nestedhvm and altp2mhvm cannot be used together");
+        goto error_out;
+    }
+
     for (i = 0; i < d_config->num_disks; i++) {
         ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) {
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d0bf0cb..9755d55 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1568,14 +1568,6 @@ static void parse_config_data(const char *config_source,
 
         xlu_cfg_get_defbool(config, "altp2mhvm", &b_info->u.hvm.altp2m, 0);
 
-        if (!libxl_defbool_is_default(b_info->u.hvm.nested_hvm) &&
-            libxl_defbool_val(b_info->u.hvm.nested_hvm) &&
-            !libxl_defbool_is_default(b_info->u.hvm.altp2m) &&
-            libxl_defbool_val(b_info->u.hvm.altp2m)) {
-            fprintf(stderr, "ERROR: nestedhvm and altp2mhvm cannot be used together\n");
-            exit(1);
-        }
-
         xlu_cfg_replace_string(config, "smbios_firmware",
                                &b_info->u.hvm.smbios_firmware, 0);
         xlu_cfg_replace_string(config, "acpi_firmware",
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:44:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:44: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 1ZLAc9-0006zC-8Q; Fri, 31 Jul 2015 13:44: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 1ZLAc8-0006yy-Hr
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:44 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	94/33-01753-BCB7BB55; Fri, 31 Jul 2015 13:44:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1438350282!31189417!1
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 1906 invoked from network); 31 Jul 2015 13:44:43 -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;
	31 Jul 2015 13:44:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAc6-0004bx-Cc
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAc6-0007PG-BZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:42 +0000
Date: Fri, 31 Jul 2015 13:44:42 +0000
Message-Id: <E1ZLAc6-0007PG-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: check nesthvm and altp2m in
	libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9041b4eeb792fa0ef42828d2d49c22484f2e363
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 15:01:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:04:12 2015 +0100

    libxl: check nesthvm and altp2m in libxl
    
    In ea214001 ("x86/altp2m: add altp2mhvm HVM domain parameter"), a
    check was added to ensure nestedhvm and altp2m cannot be enabled at
    the same time. That check was added in xl, but in fact it should be in
    libxl because it should be the entity that decides whether
    the provided configuration is valid.
    
    This patch moves the check to libxl. The code snippet is moved after
    calling libxl__domain_build_info_setdefault so that we can:
    1. remove libxl_defbool_is_default in `if()';
    2. detect mistake in libxl__domain_build_info_setdefault.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    7 +++++++
 tools/libxl/xl_cmdimpl.c   |    8 --------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 855b42c..0294844 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -883,6 +883,13 @@ static void initiate_domain_create(libxl__egc *egc,
         goto error_out;
     }
 
+    if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
+        (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) &&
+         libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) {
+        LOG(ERROR, "nestedhvm and altp2mhvm cannot be used together");
+        goto error_out;
+    }
+
     for (i = 0; i < d_config->num_disks; i++) {
         ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) {
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d0bf0cb..9755d55 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1568,14 +1568,6 @@ static void parse_config_data(const char *config_source,
 
         xlu_cfg_get_defbool(config, "altp2mhvm", &b_info->u.hvm.altp2m, 0);
 
-        if (!libxl_defbool_is_default(b_info->u.hvm.nested_hvm) &&
-            libxl_defbool_val(b_info->u.hvm.nested_hvm) &&
-            !libxl_defbool_is_default(b_info->u.hvm.altp2m) &&
-            libxl_defbool_val(b_info->u.hvm.altp2m)) {
-            fprintf(stderr, "ERROR: nestedhvm and altp2mhvm cannot be used together\n");
-            exit(1);
-        }
-
         xlu_cfg_replace_string(config, "smbios_firmware",
                                &b_info->u.hvm.smbios_firmware, 0);
         xlu_cfg_replace_string(config, "acpi_firmware",
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAcO-00071r-DX; Fri, 31 Jul 2015 13:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcN-00071i-78
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:59 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	96/D0-05427-ADB7BB55; Fri, 31 Jul 2015 13:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350292!35429597!1
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 16357 invoked from network); 31 Jul 2015 13:44: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;
	31 Jul 2015 13:44:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcG-0004c5-Jx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcG-0007Pv-HS
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:52 +0000
Date: Fri, 31 Jul 2015 13:44:52 +0000
Message-Id: <E1ZLAcG-0007Pv-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove legacy migration
	implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b15bc4345e772df92e5ffdbc4c1e9ae2a6206617
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:27 2015 +0100

    tools/libxc: Remove legacy migration implementation
    
    It is no longer used.
    
    One complication is that xc_map_m2p() has users in xc_offline_page.c,
    xen-mfndump and xen-mceinj.  Move its implementation into
    xc_offline_page (for want of a better location) beside it's current
    user.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- drop mentions of removed files from MAINTAINERS ]
---
 MAINTAINERS                     |    2 -
 tools/libxc/Makefile            |    1 -
 tools/libxc/xc_domain_restore.c | 2411 ---------------------------------------
 tools/libxc/xc_domain_save.c    | 2198 -----------------------------------
 tools/libxc/xc_offline_page.c   |   59 +
 tools/libxc/xg_save_restore.h   |  247 ----
 6 files changed, 59 insertions(+), 4859 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index a4e64ea..73a96c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -272,8 +272,6 @@ M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 M:	Yang Hongyang <yanghy@cn.fujitsu.com>
 S:	Maintained
 F:	docs/README.remus
-F:	tools/libxc/xc_domain_save.c
-F:	tools/libxc/xc_domain_restore.c
 F:	tools/blktap2/drivers/block-remus.c
 F:	tools/blktap2/drivers/hashtable*
 F:	tools/libxl/libxl_remus_*
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index b0a3e05..8ae0ea0 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -54,7 +54,6 @@ CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c xc_suspend.c
 ifeq ($(CONFIG_MIGRATE),y)
-GUEST_SRCS-y += xc_domain_restore.c xc_domain_save.c
 GUEST_SRCS-y += xc_sr_common.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
deleted file mode 100644
index 8435f6b..0000000
--- a/tools/libxc/xc_domain_restore.c
+++ /dev/null
@@ -1,2411 +0,0 @@
-/******************************************************************************
- * xc_domain_restore.c
- *
- * Restore the state of a guest session.
- *
- * Copyright (c) 2003, K A Fraser.
- * Copyright (c) 2006, Intel Corporation
- * Copyright (c) 2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-/*
- * The superpages flag in restore has two different meanings depending on
- * the type of domain.
- *
- * For an HVM domain, the flag means to look for properly aligned contiguous
- * pages and try to allocate a superpage to satisfy it.  If that fails,
- * fall back to small pages.
- *
- * For a PV domain, the flag means allocate all memory as superpages.  If that
- * fails, the restore fails.  This behavior is required for PV guests who
- * want to use superpages.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_save_restore.h"
-#include "xc_dom.h"
-
-#include <xen/hvm/ioreq.h>
-#include <xen/hvm/params.h>
-
-struct restore_ctx {
-    unsigned long max_mfn; /* max mfn of the current host machine */
-    unsigned long hvirt_start; /* virtual starting address of the hypervisor */
-    unsigned int pt_levels; /* #levels of page tables used by the current guest */
-    unsigned long nr_pfns; /* number of 'in use' pfns in the guest (i.e. #P2M entries with a valid mfn) */
-    xen_pfn_t *live_p2m; /* Live mapping of the table mapping each PFN to its current MFN. */
-    xen_pfn_t *p2m; /* A table mapping each PFN to its new MFN. */
-    xen_pfn_t *p2m_batch; /* A table of P2M mappings in the current region.  */
-    xen_pfn_t *p2m_saved_batch; /* Copy of p2m_batch array for pv superpage alloc */
-    int superpages; /* Superpage allocation has been requested */
-    int hvm;    /* This is an hvm domain */
-    int completed; /* Set when a consistent image is available */
-    int last_checkpoint; /* Set when we should commit to the current checkpoint when it completes. */
-    int compressing; /* Set when sender signals that pages would be sent compressed (for Remus) */
-    struct domain_info_context dinfo;
-};
-
-#define HEARTBEAT_MS 1000
-
-#ifndef __MINIOS__
-static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx,
-                       int fd, void* buf, size_t size)
-{
-    size_t offset = 0;
-    ssize_t len;
-    struct timeval tv;
-    fd_set rfds;
-
-    while ( offset < size )
-    {
-        if ( ctx->completed ) {
-            /* expect a heartbeat every HEARBEAT_MS ms maximum */
-            tv.tv_sec = HEARTBEAT_MS / 1000;
-            tv.tv_usec = (HEARTBEAT_MS % 1000) * 1000;
-
-            FD_ZERO(&rfds);
-            FD_SET(fd, &rfds);
-            len = select(fd + 1, &rfds, NULL, NULL, &tv);
-            if ( len == -1 && errno == EINTR )
-                continue;
-            if ( !FD_ISSET(fd, &rfds) ) {
-                ERROR("%s failed (select returned %zd)", __func__, len);
-                errno = ETIMEDOUT;
-                return -1;
-            }
-        }
-
-        len = read(fd, buf + offset, size - offset);
-        if ( (len == -1) && ((errno == EINTR) || (errno == EAGAIN)) )
-            continue;
-        if ( len == 0 ) {
-            ERROR("0-length read");
-            errno = 0;
-        }
-        if ( len <= 0 ) {
-            ERROR("%s failed (read rc: %zd, errno: %d)", __func__, len, errno);
-            return -1;
-        }
-        offset += len;
-    }
-
-    return 0;
-}
-
-#define RDEXACT(fd,buf,size) rdexact(xch, ctx, fd, buf, size)
-#else
-#define RDEXACT read_exact
-#endif
-
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
-#define SUPERPAGE(_pfn) ((_pfn) & (~(SUPERPAGE_NR_PFNS-1)))
-#define SUPER_PAGE_START(pfn)    (((pfn) & (SUPERPAGE_NR_PFNS-1)) == 0 )
-
-/*
-** When we're restoring into a pv superpage-allocated guest, we take
-** a copy of the p2m_batch array to preserve the pfn, then allocate the
-** corresponding superpages.  We then fill in the p2m array using the saved
-** pfns.
-*/
-static int alloc_superpage_mfns(
-    xc_interface *xch, uint32_t dom, struct restore_ctx *ctx, int nr_mfns)
-{
-    int i, j, max = 0;
-    unsigned long pfn, base_pfn, mfn;
-
-    for (i = 0; i < nr_mfns; i++)
-    {
-        pfn = ctx->p2m_batch[i];
-        base_pfn = SUPERPAGE(pfn);
-        if (ctx->p2m[base_pfn] != (INVALID_P2M_ENTRY-2))
-        {
-            ctx->p2m_saved_batch[max] = base_pfn;
-            ctx->p2m_batch[max] = base_pfn;
-            max++;
-            ctx->p2m[base_pfn] = INVALID_P2M_ENTRY-2;
-        }
-    }
-    if (xc_domain_populate_physmap_exact(xch, dom, max, SUPERPAGE_PFN_SHIFT,
-                                         0, ctx->p2m_batch) != 0)
-        return 1;
-
-    for (i = 0; i < max; i++)
-    {
-        mfn = ctx->p2m_batch[i];
-        pfn = ctx->p2m_saved_batch[i];
-        for (j = 0; j < SUPERPAGE_NR_PFNS; j++)
-            ctx->p2m[pfn++] = mfn++;
-    }
-    return 0;
-}
-/*
-** In the state file (or during transfer), all page-table pages are
-** converted into a 'canonical' form where references to actual mfns
-** are replaced with references to the corresponding pfns.
-** This function inverts that operation, replacing the pfn values with
-** the (now known) appropriate mfn values.
-*/
-static int uncanonicalize_pagetable(
-    xc_interface *xch, uint32_t dom, struct restore_ctx *ctx, void *page)
-{
-    int i, rc, pte_last, nr_mfns = 0;
-    unsigned long pfn;
-    uint64_t pte;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    pte_last = PAGE_SIZE / 8;
-
-    /* First pass: work out how many (if any) MFNs we need to alloc */
-    for ( i = 0; i < pte_last; i++ )
-    {
-        pte = ((uint64_t *)page)[i];
-
-        /* XXX SMH: below needs fixing for PROT_NONE etc */
-        if ( !(pte & _PAGE_PRESENT) )
-            continue;
-        
-        pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-        
-        if ( pfn >= dinfo->p2m_size )
-        {
-            /* This "page table page" is probably not one; bail. */
-            ERROR("Frame number in page table is out of range: "
-                  "i=%d pfn=0x%lx p2m_size=%lu",
-                  i, pfn, dinfo->p2m_size);
-            return 0;
-        }
-        
-        if ( ctx->p2m[pfn] == INVALID_P2M_ENTRY )
-        {
-            /* Have a 'valid' PFN without a matching MFN - need to alloc */
-            ctx->p2m_batch[nr_mfns++] = pfn; 
-            ctx->p2m[pfn]--;
-        }
-    }
-
-    /* Allocate the requisite number of mfns. */
-    if (nr_mfns)
-    {
-        if (!ctx->hvm && ctx->superpages)
-            rc = alloc_superpage_mfns(xch, dom, ctx, nr_mfns);
-        else
-            rc = xc_domain_populate_physmap_exact(xch, dom, nr_mfns, 0, 0,
-                                                  ctx->p2m_batch);
-
-        if (rc)
-        {
-            ERROR("Failed to allocate memory for batch.!\n");
-            errno = ENOMEM;
-            return 0;
-        }
-    }
-    
-    /* Second pass: uncanonicalize each present PTE */
-    nr_mfns = 0;
-    for ( i = 0; i < pte_last; i++ )
-    {
-        pte = ((uint64_t *)page)[i];
-        
-        /* XXX SMH: below needs fixing for PROT_NONE etc */
-        if ( !(pte & _PAGE_PRESENT) )
-            continue;
-        
-        pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-
-        if ( ctx->p2m[pfn] == (INVALID_P2M_ENTRY-1) )
-            ctx->p2m[pfn] = ctx->p2m_batch[nr_mfns++];
-
-        pte &= ~MADDR_MASK_X86;
-        pte |= (uint64_t)ctx->p2m[pfn] << PAGE_SHIFT;
-
-        ((uint64_t *)page)[i] = (uint64_t)pte;
-    }
-
-    return 1;
-}
-
-
-/* Load the p2m frame list, plus potential extended info chunk */
-static xen_pfn_t *load_p2m_frame_list(
-    xc_interface *xch, struct restore_ctx *ctx,
-    int io_fd, int *pae_extended_cr3, int *ext_vcpucontext,
-    uint32_t *vcpuextstate_size)
-{
-    xen_pfn_t *p2m_frame_list;
-    vcpu_guest_context_any_t ctxt;
-    xen_pfn_t p2m_fl_zero;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    /* Read first entry of P2M list, or extended-info signature (~0UL). */
-    if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(long)) )
-    {
-        PERROR("read extended-info signature failed");
-        return NULL;
-    }
-    
-    if ( p2m_fl_zero == ~0UL )
-    {
-        uint32_t tot_bytes;
-        
-        /* Next 4 bytes: total size of following extended info. */
-        if ( RDEXACT(io_fd, &tot_bytes, sizeof(tot_bytes)) )
-        {
-            PERROR("read extended-info size failed");
-            return NULL;
-        }
-        
-        while ( tot_bytes )
-        {
-            uint32_t chunk_bytes;
-            char     chunk_sig[4];
-            
-            /* 4-character chunk signature + 4-byte remaining chunk size. */
-            if ( RDEXACT(io_fd, chunk_sig, sizeof(chunk_sig)) ||
-                 RDEXACT(io_fd, &chunk_bytes, sizeof(chunk_bytes)) ||
-                 (tot_bytes < (chunk_bytes + 8)) )
-            {
-                PERROR("read extended-info chunk signature failed");
-                return NULL;
-            }
-            tot_bytes -= 8;
-
-            /* VCPU context structure? */
-            if ( !strncmp(chunk_sig, "vcpu", 4) )
-            {
-                /* Pick a guest word-size and PT depth from the ctxt size */
-                if ( chunk_bytes == sizeof (ctxt.x32) )
-                {
-                    dinfo->guest_width = 4;
-                    ctx->pt_levels = 3;
-                }
-                else if ( chunk_bytes == sizeof (ctxt.x64) )
-                {
-                    dinfo->guest_width = 8;
-                    ctx->pt_levels = 4;
-                }
-                else 
-                {
-                    ERROR("bad extended-info context size %d", chunk_bytes);
-                    return NULL;
-                }
-
-                if ( RDEXACT(io_fd, &ctxt, chunk_bytes) )
-                {
-                    PERROR("read extended-info vcpu context failed");
-                    return NULL;
-                }
-                tot_bytes -= chunk_bytes;
-                chunk_bytes = 0;
-
-                if ( GET_FIELD(&ctxt, vm_assist, dinfo->guest_width)
-                     & (1UL << VMASST_TYPE_pae_extended_cr3) )
-                    *pae_extended_cr3 = 1;
-            }
-            else if ( !strncmp(chunk_sig, "extv", 4) )
-            {
-                *ext_vcpucontext = 1;
-            }
-            else if ( !strncmp(chunk_sig, "xcnt", 4) )
-            {
-                if ( RDEXACT(io_fd, vcpuextstate_size, sizeof(*vcpuextstate_size)) )
-                {
-                    PERROR("read extended vcpu state size failed");
-                    return NULL;
-                }
-                tot_bytes -= chunk_bytes;
-                chunk_bytes = 0;
-            }
-            
-            /* Any remaining bytes of this chunk: read and discard. */
-            while ( chunk_bytes )
-            {
-                unsigned long sz = min_t(unsigned long, chunk_bytes, sizeof(xen_pfn_t));
-                if ( RDEXACT(io_fd, &p2m_fl_zero, sz) )
-                {
-                    PERROR("read-and-discard extended-info chunk bytes failed");
-                    return NULL;
-                }
-                chunk_bytes -= sz;
-                tot_bytes   -= sz;
-            }
-        }
-
-        /* Now read the real first entry of P2M list. */
-        if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(xen_pfn_t)) )
-        {
-            PERROR("read first entry of p2m_frame_list failed");
-            return NULL;
-        }
-    }
-
-    /* Now that we know the guest's word-size, can safely allocate 
-     * the p2m frame list */
-    if ( (p2m_frame_list = malloc(P2M_TOOLS_FL_SIZE)) == NULL )
-    {
-        ERROR("Couldn't allocate p2m_frame_list array");
-        return NULL;
-    }
-
-    /* First entry has already been read. */
-    p2m_frame_list[0] = p2m_fl_zero;
-    if ( RDEXACT(io_fd, &p2m_frame_list[1], 
-                 (P2M_FL_ENTRIES - 1) * sizeof(xen_pfn_t)) )
-    {
-        PERROR("read p2m_frame_list failed");
-        free(p2m_frame_list);
-        return NULL;
-    }
-    
-    return p2m_frame_list;
-}
-
-typedef struct {
-    int ishvm;
-    union {
-        struct tailbuf_pv {
-            unsigned int pfncount;
-            unsigned long* pfntab;
-            unsigned int vcpucount;
-            unsigned char* vcpubuf;
-            unsigned char shared_info_page[PAGE_SIZE];
-        } pv;
-        struct tailbuf_hvm {
-            uint64_t magicpfns[3];
-            uint32_t hvmbufsize, reclen;
-            uint8_t* hvmbuf;
-            struct {
-                uint32_t magic;
-                uint32_t version;
-                uint64_t len;
-            } qemuhdr;
-            uint32_t qemubufsize;
-            uint8_t* qemubuf;
-        } hvm;
-    } u;
-} tailbuf_t;
-
-/* read stream until EOF, growing buffer as necssary */
-static int compat_buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
-                              int fd, struct tailbuf_hvm *buf)
-{
-    uint8_t *qbuf, *tmp;
-    int blen = 0, dlen = 0;
-    int rc;
-
-    /* currently save records tend to be about 7K */
-    blen = 8192;
-    if ( !(qbuf = malloc(blen)) ) {
-        ERROR("Error allocating QEMU buffer");
-        return -1;
-    }
-
-    while( (rc = read(fd, qbuf+dlen, blen-dlen)) > 0 ) {
-        DPRINTF("Read %d bytes of QEMU data\n", rc);
-        dlen += rc;
-
-        if (dlen == blen) {
-            DPRINTF("%d-byte QEMU buffer full, reallocating...\n", dlen);
-            blen += 4096;
-            tmp = realloc(qbuf, blen);
-            if ( !tmp ) {
-                ERROR("Error growing QEMU buffer to %d bytes", blen);
-                free(qbuf);
-                return -1;
-            }
-            qbuf = tmp;
-        }
-    }
-
-    if ( rc < 0 ) {
-        ERROR("Error reading QEMU data");
-        free(qbuf);
-        return -1;
-    }
-
-    if ( memcmp(qbuf, "QEVM", 4) ) {
-        ERROR("Invalid QEMU magic: 0x%08"PRIx32, *(uint32_t*)qbuf);
-        free(qbuf);
-        return -1;
-    }
-
-    buf->qemubuf = qbuf;
-    buf->qemubufsize = dlen;
-
-    return 0;
-}
-
-static int buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
-                       int fd, struct tailbuf_hvm *buf)
-{
-    uint32_t qlen;
-    uint8_t *tmp;
-
-    if ( RDEXACT(fd, &qlen, sizeof(qlen)) ) {
-        PERROR("Error reading QEMU header length");
-        return -1;
-    }
-
-    if ( qlen > buf->qemubufsize ) {
-        if ( buf->qemubuf) {
-            tmp = realloc(buf->qemubuf, qlen);
-            if ( tmp )
-                buf->qemubuf = tmp;
-            else {
-                ERROR("Error reallocating QEMU state buffer");
-                return -1;
-            }
-        } else {
-            buf->qemubuf = malloc(qlen);
-            if ( !buf->qemubuf ) {
-                ERROR("Error allocating QEMU state buffer");
-                return -1;
-            }
-        }
-    }
-    buf->qemubufsize = qlen;
-
-    if ( RDEXACT(fd, buf->qemubuf, buf->qemubufsize) ) {
-        PERROR("Error reading QEMU state");
-        return -1;
-    }
-
-    return 0;
-}
-
-static int dump_qemu(xc_interface *xch, uint32_t dom, struct tailbuf_hvm *buf)
-{
-    int saved_errno;
-    char path[256];
-    FILE *fp;
-
-    sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dom);
-    fp = fopen(path, "wb");
-    if ( !fp )
-        return -1;
-
-    DPRINTF("Writing %d bytes of QEMU data\n", buf->qemubufsize);
-    if ( fwrite(buf->qemubuf, 1, buf->qemubufsize, fp) != buf->qemubufsize) {
-        saved_errno = errno;
-        fclose(fp);
-        errno = saved_errno;
-        return -1;
-    }
-
-    fclose(fp);
-
-    return 0;
-}
-
-static int buffer_tail_hvm(xc_interface *xch, struct restore_ctx *ctx,
-                           struct tailbuf_hvm *buf, int fd,
-                           unsigned int max_vcpu_id, uint64_t *vcpumap,
-                           int ext_vcpucontext,
-                           uint32_t vcpuextstate_size)
-{
-    uint8_t *tmp;
-    unsigned char qemusig[21];
-
-    if ( RDEXACT(fd, buf->magicpfns, sizeof(buf->magicpfns)) ) {
-        PERROR("Error reading magic PFNs");
-        return -1;
-    }
-
-    if ( RDEXACT(fd, &buf->reclen, sizeof(buf->reclen)) ) {
-        PERROR("Error reading HVM params size");
-        return -1;
-    }
-
-    if ( buf->reclen > buf->hvmbufsize ) {
-        if ( buf->hvmbuf) {
-            tmp = realloc(buf->hvmbuf, buf->reclen);
-            if ( tmp ) {
-                buf->hvmbuf = tmp;
-                buf->hvmbufsize = buf->reclen;
-            } else {
-                ERROR("Error reallocating HVM param buffer");
-                return -1;
-            }
-        } else {
-            buf->hvmbuf = malloc(buf->reclen);
-            if ( !buf->hvmbuf ) {
-                ERROR("Error allocating HVM param buffer");
-                return -1;
-            }
-            buf->hvmbufsize = buf->reclen;
-        }
-    }
-
-    if ( RDEXACT(fd, buf->hvmbuf, buf->reclen) ) {
-        PERROR("Error reading HVM params");
-        return -1;
-    }
-
-    if ( RDEXACT(fd, qemusig, sizeof(qemusig)) ) {
-        PERROR("Error reading QEMU signature");
-        return -1;
-    }
-
-    /* The legacy live-migration QEMU record has no length information.
-     * Short of reimplementing the QEMU parser, we're forced to just read
-     * until EOF.
-     *
-     * Gets around this by sending a different signatures for the new
-     * live-migration QEMU record and Remus which includes a length
-     * prefix
-     */
-    if ( !memcmp(qemusig, "QemuDeviceModelRecord", sizeof(qemusig)) )
-        return compat_buffer_qemu(xch, ctx, fd, buf);
-    else if ( !memcmp(qemusig, "DeviceModelRecord0002", sizeof(qemusig)) ||
-              !memcmp(qemusig, "RemusDeviceModelState", sizeof(qemusig)) )
-        return buffer_qemu(xch, ctx, fd, buf);
-
-    qemusig[20] = '\0';
-    ERROR("Invalid QEMU signature: %s", qemusig);
-    return -1;
-}
-
-static int buffer_tail_pv(xc_interface *xch, struct restore_ctx *ctx,
-                          struct tailbuf_pv *buf, int fd,
-                          unsigned int max_vcpu_id, uint64_t *vcpumap,
-                          int ext_vcpucontext,
-                          uint32_t vcpuextstate_size)
-{
-    unsigned int i;
-    size_t pfnlen, vcpulen;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    /* TODO: handle changing pfntab and vcpu counts */
-    /* PFN tab */
-    if ( RDEXACT(fd, &buf->pfncount, sizeof(buf->pfncount)) ||
-         (buf->pfncount > (1U << 28)) ) /* up to 1TB of address space */
-    {
-        PERROR("Error when reading pfn count");
-        return -1;
-    }
-    pfnlen = sizeof(unsigned long) * buf->pfncount;
-    if ( !(buf->pfntab) ) {
-        if ( !(buf->pfntab = malloc(pfnlen)) ) {
-            ERROR("Error allocating PFN tail buffer");
-            return -1;
-        }
-    }
-    // DPRINTF("Reading PFN tab: %d bytes\n", pfnlen);
-    if ( RDEXACT(fd, buf->pfntab, pfnlen) ) {
-        PERROR("Error when reading pfntab");
-        goto free_pfntab;
-    }
-
-    /* VCPU contexts */
-    buf->vcpucount = 0;
-    for (i = 0; i <= max_vcpu_id; i++) {
-        // DPRINTF("vcpumap: %llx, cpu: %d, bit: %llu\n", vcpumap[i/64], i, (vcpumap[i/64] & (1ULL << (i%64))));
-        if ( (!(vcpumap[i/64] & (1ULL << (i%64)))) )
-            continue;
-        buf->vcpucount++;
-    }
-    // DPRINTF("VCPU count: %d\n", buf->vcpucount);
-    vcpulen = ((dinfo->guest_width == 8) ? sizeof(vcpu_guest_context_x86_64_t)
-               : sizeof(vcpu_guest_context_x86_32_t)) * buf->vcpucount;
-    if ( ext_vcpucontext )
-        vcpulen += 128 * buf->vcpucount;
-    vcpulen += vcpuextstate_size * buf->vcpucount;
-
-    if ( !(buf->vcpubuf) ) {
-        if ( !(buf->vcpubuf = malloc(vcpulen)) ) {
-            ERROR("Error allocating VCPU ctxt tail buffer");
-            goto free_pfntab;
-        }
-    }
-    // DPRINTF("Reading VCPUS: %d bytes\n", vcpulen);
-    if ( RDEXACT(fd, buf->vcpubuf, vcpulen) ) {
-        PERROR("Error when reading ctxt");
-        goto free_vcpus;
-    }
-
-    /* load shared_info_page */
-    // DPRINTF("Reading shared info: %lu bytes\n", PAGE_SIZE);
-    if ( RDEXACT(fd, buf->shared_info_page, PAGE_SIZE) ) {
-        PERROR("Error when reading shared info page");
-        goto free_vcpus;
-    }
-
-    return 0;
-
-  free_vcpus:
-    if (buf->vcpubuf) {
-        free (buf->vcpubuf);
-        buf->vcpubuf = NULL;
-    }
-  free_pfntab:
-    if (buf->pfntab) {
-        free (buf->pfntab);
-        buf->pfntab = NULL;
-    }
-
-    return -1;
-}
-
-static int buffer_tail(xc_interface *xch, struct restore_ctx *ctx,
-                       tailbuf_t *buf, int fd, unsigned int max_vcpu_id,
-                       uint64_t *vcpumap, int ext_vcpucontext,
-                       uint32_t vcpuextstate_size)
-{
-    if ( buf->ishvm )
-        return buffer_tail_hvm(xch, ctx, &buf->u.hvm, fd, max_vcpu_id, vcpumap,
-                               ext_vcpucontext, vcpuextstate_size);
-    else
-        return buffer_tail_pv(xch, ctx, &buf->u.pv, fd, max_vcpu_id, vcpumap,
-                              ext_vcpucontext, vcpuextstate_size);
-}
-
-static void tailbuf_free_hvm(struct tailbuf_hvm *buf)
-{
-    if ( buf->hvmbuf ) {
-        free(buf->hvmbuf);
-        buf->hvmbuf = NULL;
-    }
-    if ( buf->qemubuf ) {
-        free(buf->qemubuf);
-        buf->qemubuf = NULL;
-    }
-}
-
-static void tailbuf_free_pv(struct tailbuf_pv *buf)
-{
-    if ( buf->vcpubuf ) {
-        free(buf->vcpubuf);
-        buf->vcpubuf = NULL;
-    }
-    if ( buf->pfntab ) {
-        free(buf->pfntab);
-        buf->pfntab = NULL;
-    }
-}
-
-static void tailbuf_free(tailbuf_t *buf)
-{
-    if ( buf->ishvm )
-        tailbuf_free_hvm(&buf->u.hvm);
-    else
-        tailbuf_free_pv(&buf->u.pv);
-}
-
-struct toolstack_data_t {
-    uint8_t *data;
-    uint32_t len;
-};
-
-typedef struct {
-    void* pages;
-    /* pages is of length nr_physpages, pfn_types is of length nr_pages */
-    unsigned int nr_physpages, nr_pages;
-
-    /* checkpoint compression state */
-    int compressing;
-    unsigned long compbuf_pos, compbuf_size;
-
-    /* Types of the pfns in the current region */
-    unsigned long* pfn_types;
-
-    int verify;
-
-    int new_ctxt_format;
-    int max_vcpu_id;
-    uint64_t vcpumap[XC_SR_MAX_VCPUS/64];
-    uint64_t identpt;
-    uint64_t paging_ring_pfn;
-    uint64_t monitor_ring_pfn;
-    uint64_t sharing_ring_pfn;
-    uint64_t vm86_tss;
-    uint64_t console_pfn;
-    uint64_t acpi_ioport_location;
-    uint64_t viridian;
-    uint64_t vm_generationid_addr;
-    uint64_t ioreq_server_pfn;
-    uint64_t nr_ioreq_server_pages;
-
-    struct toolstack_data_t tdata;
-} pagebuf_t;
-
-static int pagebuf_init(pagebuf_t* buf)
-{
-    memset(buf, 0, sizeof(*buf));
-    return 0;
-}
-
-static void pagebuf_free(pagebuf_t* buf)
-{
-    if (buf->tdata.data != NULL) {
-        free(buf->tdata.data);
-        buf->tdata.data = NULL;
-    }
-    if (buf->pages) {
-        free(buf->pages);
-        buf->pages = NULL;
-    }
-    if(buf->pfn_types) {
-        free(buf->pfn_types);
-        buf->pfn_types = NULL;
-    }
-}
-
-static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx,
-                           pagebuf_t* buf, int fd, uint32_t dom)
-{
-    int count, countpages, oldcount, i;
-    void* ptmp;
-    unsigned long compbuf_size;
-
-    if ( RDEXACT(fd, &count, sizeof(count)) )
-    {
-        PERROR("Error when reading batch size");
-        return -1;
-    }
-
-    // DPRINTF("reading batch of %d pages\n", count);
-
-    switch ( count )
-    {
-    case 0:
-        // DPRINTF("Last batch read\n");
-        return 0;
-
-    case XC_SAVE_ID_ENABLE_VERIFY_MODE:
-        DPRINTF("Entering page verify mode\n");
-        buf->verify = 1;
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_VCPU_INFO:
-        buf->new_ctxt_format = 1;
-        if ( RDEXACT(fd, &buf->max_vcpu_id, sizeof(buf->max_vcpu_id)) ||
-             buf->max_vcpu_id >= XC_SR_MAX_VCPUS ||
-             RDEXACT(fd, buf->vcpumap, vcpumap_sz(buf->max_vcpu_id)) ) {
-            PERROR("Error when reading max_vcpu_id");
-            return -1;
-        }
-        // DPRINTF("Max VCPU ID: %d, vcpumap: %llx\n", buf->max_vcpu_id, buf->vcpumap[0]);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_IDENT_PT:
-        /* Skip padding 4 bytes then read the EPT identity PT location. */
-        if ( RDEXACT(fd, &buf->identpt, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->identpt, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the EPT identity map");
-            return -1;
-        }
-        // DPRINTF("EPT identity map address: %llx\n", buf->identpt);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_PAGING_RING_PFN:
-        /* Skip padding 4 bytes then read the paging ring location. */
-        if ( RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the paging ring pfn");
-            return -1;
-        }
-        // DPRINTF("paging ring pfn address: %llx\n", buf->paging_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_MONITOR_RING_PFN:
-        /* Skip padding 4 bytes then read the mem access ring location. */
-        if ( RDEXACT(fd, &buf->monitor_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->monitor_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the access ring pfn");
-            return -1;
-        }
-        // DPRINTF("monitor ring pfn address: %llx\n", buf->monitor_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_SHARING_RING_PFN:
-        /* Skip padding 4 bytes then read the sharing ring location. */
-        if ( RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the sharing ring pfn");
-            return -1;
-        }
-        // DPRINTF("sharing ring pfn address: %llx\n", buf->sharing_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_VM86_TSS:
-        /* Skip padding 4 bytes then read the vm86 TSS location. */
-        if ( RDEXACT(fd, &buf->vm86_tss, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->vm86_tss, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the vm86 TSS");
-            return -1;
-        }
-        // DPRINTF("VM86 TSS location: %llx\n", buf->vm86_tss);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TMEM:
-        DPRINTF("xc_domain_restore start tmem\n");
-        if ( xc_tmem_restore(xch, dom, fd) ) {
-            PERROR("error reading/restoring tmem");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TMEM_EXTRA:
-        if ( xc_tmem_restore_extra(xch, dom, fd) ) {
-            PERROR("error reading/restoring tmem extra");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TSC_INFO:
-    {
-        uint32_t tsc_mode, khz, incarn;
-        uint64_t nsec;
-        if ( RDEXACT(fd, &tsc_mode, sizeof(uint32_t)) ||
-             RDEXACT(fd, &nsec, sizeof(uint64_t)) ||
-             RDEXACT(fd, &khz, sizeof(uint32_t)) ||
-             RDEXACT(fd, &incarn, sizeof(uint32_t)) ||
-             xc_domain_set_tsc_info(xch, dom, tsc_mode, nsec, khz, incarn) ) {
-            PERROR("error reading/restoring tsc info");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-    }
-
-    case XC_SAVE_ID_HVM_CONSOLE_PFN :
-        /* Skip padding 4 bytes then read the console pfn location. */
-        if ( RDEXACT(fd, &buf->console_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->console_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the console pfn");
-            return -1;
-        }
-        // DPRINTF("console pfn location: %llx\n", buf->console_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_LAST_CHECKPOINT:
-        ctx->last_checkpoint = 1;
-        // DPRINTF("last checkpoint indication received");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION:
-        /* Skip padding 4 bytes then read the acpi ioport location. */
-        if ( RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint64_t)) )
-        {
-            PERROR("error read the acpi ioport location");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_VIRIDIAN:
-        /* Skip padding 4 bytes then read the acpi ioport location. */
-        if ( RDEXACT(fd, &buf->viridian, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->viridian, sizeof(uint64_t)) )
-        {
-            PERROR("error reading the viridian enlightenments");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TOOLSTACK:
-        {
-            if ( RDEXACT(fd, &buf->tdata.len, sizeof(buf->tdata.len)) )
-            {
-                PERROR("error read toolstack id size");
-                return -1;
-            }
-            buf->tdata.data = (uint8_t*) realloc(buf->tdata.data, buf->tdata.len);
-            if ( buf->tdata.data == NULL )
-            {
-                PERROR("error memory allocation");
-                return -1;
-            }
-            if ( RDEXACT(fd, buf->tdata.data, buf->tdata.len) )
-            {
-                PERROR("error read toolstack id");
-                return -1;
-            }
-            return pagebuf_get_one(xch, ctx, buf, fd, dom);
-        }
-
-    case XC_SAVE_ID_ENABLE_COMPRESSION:
-        /* We cannot set compression flag directly in pagebuf structure,
-         * since this pagebuf still has uncompressed pages that are yet to
-         * be applied. We enable the compression field in pagebuf structure
-         * after receiving the first tailbuf.
-         */
-        ctx->compressing = 1;
-        // DPRINTF("compression flag received");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_COMPRESSED_DATA:
-
-        /* read the length of compressed chunk coming in */
-        if ( RDEXACT(fd, &compbuf_size, sizeof(unsigned long)) )
-        {
-            PERROR("Error when reading compbuf_size");
-            return -1;
-        }
-        if (!compbuf_size) return 1;
-
-        buf->compbuf_size += compbuf_size;
-        if (!(ptmp = realloc(buf->pages, buf->compbuf_size))) {
-            ERROR("Could not (re)allocate compression buffer");
-            return -1;
-        }
-        buf->pages = ptmp;
-
-        if ( RDEXACT(fd, buf->pages + (buf->compbuf_size - compbuf_size),
-                     compbuf_size) ) {
-            PERROR("Error when reading compression buffer");
-            return -1;
-        }
-        return compbuf_size;
-
-    case XC_SAVE_ID_HVM_GENERATION_ID_ADDR:
-        /* Skip padding 4 bytes then read the generation id buffer location. */
-        if ( RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint64_t)) )
-        {
-            PERROR("error read the generation id buffer location");
-            return -1;
-        }
-        DPRINTF("read generation id buffer address");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_IOREQ_SERVER_PFN:
-        /* Skip padding 4 bytes then read the ioreq server gmfn base. */
-        if ( RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the ioreq server gmfn base");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES:
-        /* Skip padding 4 bytes then read the ioreq server gmfn count. */
-        if ( RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint64_t)) )
-        {
-            PERROR("error read the ioreq server gmfn count");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    default:
-        if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
-            ERROR("Max batch size exceeded (%d). Giving up.", count);
-            errno = EMSGSIZE;
-            return -1;
-        }
-        break;
-    }
-
-    oldcount = buf->nr_pages;
-    buf->nr_pages += count;
-    if (!buf->pfn_types) {
-        if (!(buf->pfn_types = malloc(buf->nr_pages * sizeof(*(buf->pfn_types))))) {
-            ERROR("Could not allocate PFN type buffer");
-            return -1;
-        }
-    } else {
-        if (!(ptmp = realloc(buf->pfn_types, buf->nr_pages * sizeof(*(buf->pfn_types))))) {
-            ERROR("Could not reallocate PFN type buffer");
-            return -1;
-        }
-        buf->pfn_types = ptmp;
-    }
-    if ( RDEXACT(fd, buf->pfn_types + oldcount, count * sizeof(*(buf->pfn_types)))) {
-        PERROR("Error when reading region pfn types");
-        return -1;
-    }
-
-    countpages = count;
-    for (i = oldcount; i < buf->nr_pages; ++i)
-    {
-        unsigned long pagetype;
-
-        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
-             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
-             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
-            --countpages;
-    }
-
-    if (!countpages)
-        return count;
-
-    /* If Remus Checkpoint Compression is turned on, we will only be
-     * receiving the pfn lists now. The compressed pages will come in later,
-     * following a <XC_SAVE_ID_COMPRESSED_DATA, compressedChunkSize> tuple.
-     */
-    if (buf->compressing)
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    oldcount = buf->nr_physpages;
-    buf->nr_physpages += countpages;
-    if (!buf->pages) {
-        if (!(buf->pages = malloc(buf->nr_physpages * PAGE_SIZE))) {
-            ERROR("Could not allocate page buffer");
-            return -1;
-        }
-    } else {
-        if (!(ptmp = realloc(buf->pages, buf->nr_physpages * PAGE_SIZE))) {
-            ERROR("Could not reallocate page buffer");
-            return -1;
-        }
-        buf->pages = ptmp;
-    }
-    if ( RDEXACT(fd, buf->pages + oldcount * PAGE_SIZE, countpages * PAGE_SIZE) ) {
-        PERROR("Error when reading pages");
-        return -1;
-    }
-
-    return count;
-}
-
-static int pagebuf_get(xc_interface *xch, struct restore_ctx *ctx,
-                       pagebuf_t* buf, int fd, uint32_t dom)
-{
-    int rc;
-
-    buf->nr_physpages = buf->nr_pages = 0;
-    buf->compbuf_pos = buf->compbuf_size = 0;
-
-    do {
-        rc = pagebuf_get_one(xch, ctx, buf, fd, dom);
-    } while (rc > 0);
-
-    if (rc < 0)
-        pagebuf_free(buf);
-
-    return rc;
-}
-
-static int apply_batch(xc_interface *xch, uint32_t dom, struct restore_ctx *ctx,
-                       xen_pfn_t* region_mfn, unsigned long* pfn_type, int pae_extended_cr3,
-                       struct xc_mmu* mmu,
-                       pagebuf_t* pagebuf, int curbatch, int *invalid_pages)
-{
-    int i, j, curpage, nr_mfns;
-    int k, scount;
-    unsigned long superpage_start=INVALID_P2M_ENTRY;
-    /* used by debug verify code */
-    unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
-    /* Our mapping of the current region (batch) */
-    char *region_base;
-    /* A temporary mapping, and a copy, of one frame of guest memory. */
-    unsigned long *page = NULL;
-    int nraces = 0;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    int* pfn_err = NULL;
-    int rc = -1;
-    int local_invalid_pages = 0;
-    /* We have handled curbatch pages before this batch, and there are
-     * *invalid_pages pages that are not in pagebuf->pages. So the first
-     * page for this page is (curbatch - *invalid_pages) page.
-     */
-    int first_page = curbatch - *invalid_pages;
-
-    unsigned long mfn, pfn, pagetype;
-
-    j = pagebuf->nr_pages - curbatch;
-    if (j > MAX_BATCH_SIZE)
-        j = MAX_BATCH_SIZE;
-
-    /* First pass for this batch: work out how much memory to alloc, and detect superpages */
-    nr_mfns = scount = 0;
-    for ( i = 0; i < j; i++ )
-    {
-        unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        /* For allocation purposes, treat XEN_DOMCTL_PFINFO_XALLOC as a normal page */
-        if ( (pagetype != XEN_DOMCTL_PFINFO_XTAB) && 
-             (ctx->p2m[pfn] == INVALID_P2M_ENTRY) )
-        {
-            /* Have a live PFN which hasn't had an MFN allocated */
-
-            /* Logic if we're in the middle of detecting a candidate superpage */
-            if ( superpage_start != INVALID_P2M_ENTRY )
-            {
-                /* Is this the next expected continuation? */
-                if ( pfn == superpage_start + scount )
-                {
-                    if ( !ctx->superpages )
-                    {
-                        ERROR("Unexpexted codepath with no superpages");
-                        return -1;
-                    }
-
-                    scount++;
-
-                    /* If we've found a whole superpage, allocate it and update p2m */
-                    if ( scount  == SUPERPAGE_NR_PFNS )
-                    {
-                        unsigned long supermfn;
-
-
-                        supermfn=superpage_start;
-                        if ( xc_domain_populate_physmap_exact(xch, dom, 1,
-                                         SUPERPAGE_PFN_SHIFT, 0, &supermfn) != 0 )
-                        {
-                            DPRINTF("No 2M page available for pfn 0x%lx, fall back to 4K page.\n",
-                                    superpage_start);
-                            /* If we're falling back from a failed allocation, subtract one
-                             * from count, since the last page == pfn, which will behandled
-                             * anyway. */
-                            scount--;
-                            goto fallback;
-                        }
-
-                        DPRINTF("Mapping superpage (%d) pfn %lx, mfn %lx\n", scount, superpage_start, supermfn);
-                        for (k=0; k<scount; k++)
-                        {
-                            /* We just allocated a new mfn above; update p2m */
-                            ctx->p2m[superpage_start+k] = supermfn+k;
-                            ctx->nr_pfns++;
-                            /* region_map[] will be set below */
-                        }
-                        superpage_start=INVALID_P2M_ENTRY;
-                        scount=0;
-                    }
-                    continue;
-                }
-                
-            fallback:
-                DPRINTF("Falling back %d pages pfn %lx\n", scount, superpage_start);
-                for (k=0; k<scount; k++)
-                {
-                    ctx->p2m_batch[nr_mfns++] = superpage_start+k; 
-                    ctx->p2m[superpage_start+k]--;
-                }
-                superpage_start = INVALID_P2M_ENTRY;
-                scount=0;
-            }
-
-            /* Are we ready to start a new superpage candidate? */
-            if ( ctx->hvm && ctx->superpages && SUPER_PAGE_START(pfn) )
-            {
-                superpage_start=pfn;
-                scount++;
-            }
-            else
-            {
-                /* Add the current pfn to pfn_batch */
-                ctx->p2m_batch[nr_mfns++] = pfn;
-                ctx->p2m[pfn]--;
-            }
-        }
-    }
-
-    /* Clean up any partial superpage candidates */
-    if ( superpage_start != INVALID_P2M_ENTRY )
-    {
-        DPRINTF("Falling back %d pages pfn %lx\n", scount, superpage_start);
-        for (k=0; k<scount; k++)
-        {
-            ctx->p2m_batch[nr_mfns++] = superpage_start+k; 
-            ctx->p2m[superpage_start+k]--;
-        }
-        superpage_start = INVALID_P2M_ENTRY;
-    }
-
-    /* Now allocate a bunch of mfns for this batch */
-    if ( nr_mfns )
-    {
-        DPRINTF("Mapping order 0,  %d; first pfn %lx\n", nr_mfns, ctx->p2m_batch[0]);
-    
-        if (!ctx->hvm && ctx->superpages)
-            rc = alloc_superpage_mfns(xch, dom, ctx, nr_mfns);
-        else
-            rc = xc_domain_populate_physmap_exact(xch, dom, nr_mfns, 0, 0,
-                                                  ctx->p2m_batch);
-
-        if (rc)
-        {
-            ERROR("Failed to allocate memory for batch.!\n"); 
-            errno = ENOMEM;
-            return -1;
-        }
-    }
-
-    /* Second pass for this batch: update p2m[] and region_mfn[] */
-    nr_mfns = 0; 
-    for ( i = 0; i < j; i++ )
-    {
-        unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        if ( pagetype != XEN_DOMCTL_PFINFO_XTAB
-             && ctx->p2m[pfn] == (INVALID_P2M_ENTRY-1) )
-        {
-            /* We just allocated a new mfn above; update p2m */
-            ctx->p2m[pfn] = ctx->p2m_batch[nr_mfns++]; 
-            ctx->nr_pfns++; 
-        }
-
-        /* setup region_mfn[] for batch map, if necessary.
-         * For HVM guests, this interface takes PFNs, not MFNs */
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
-             || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
-            region_mfn[i] = ~0UL; /* map will fail but we don't care */
-        else
-            region_mfn[i] = ctx->hvm ? pfn : ctx->p2m[pfn];
-    }
-
-    /* Map relevant mfns */
-    pfn_err = calloc(j, sizeof(*pfn_err));
-    if ( pfn_err == NULL )
-    {
-        PERROR("allocation for pfn_err failed");
-        return -1;
-    }
-    region_base = xc_map_foreign_bulk(
-        xch, dom, PROT_WRITE, region_mfn, pfn_err, j);
-
-    if ( region_base == NULL )
-    {
-        PERROR("map batch failed");
-        free(pfn_err);
-        return -1;
-    }
-
-    for ( i = 0, curpage = -1; i < j; i++ )
-    {
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
-             || pagetype == XEN_DOMCTL_PFINFO_XALLOC)
-        {
-            local_invalid_pages++;
-            /* a bogus/unmapped/allocate-only page: skip it */
-            continue;
-        }
-
-        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
-        {
-            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
-            {
-                ERROR("Set p2m for broken page failed, "
-                      "dom=%d, pfn=%lx\n", dom, pfn);
-                goto err_mapped;
-            }
-
-            local_invalid_pages++;
-            continue;
-        }
-
-        if (pfn_err[i])
-        {
-            ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
-                  pfn, region_mfn[i], ctx->p2m[pfn]);
-            goto err_mapped;
-        }
-
-        ++curpage;
-
-        if ( pfn > dinfo->p2m_size )
-        {
-            ERROR("pfn out of range");
-            goto err_mapped;
-        }
-
-        pfn_type[pfn] = pagetype;
-
-        mfn = ctx->p2m[pfn];
-
-        /* In verify mode, we use a copy; otherwise we work in place */
-        page = pagebuf->verify ? (void *)buf : (region_base + i*PAGE_SIZE);
-
-        /* Remus - page decompression */
-        if (pagebuf->compressing)
-        {
-            if (xc_compression_uncompress_page(xch, pagebuf->pages,
-                                               pagebuf->compbuf_size,
-                                               &pagebuf->compbuf_pos,
-                                               (char *)page))
-            {
-                ERROR("Failed to uncompress page (pfn=%lx)\n", pfn);
-                goto err_mapped;
-            }
-        }
-        else
-            memcpy(page, pagebuf->pages + (first_page + curpage) * PAGE_SIZE,
-                   PAGE_SIZE);
-
-        pagetype &= XEN_DOMCTL_PFINFO_LTABTYPE_MASK;
-
-        if ( (pagetype >= XEN_DOMCTL_PFINFO_L1TAB) &&
-             (pagetype <= XEN_DOMCTL_PFINFO_L4TAB) )
-        {
-            /*
-            ** A page table page - need to 'uncanonicalize' it, i.e.
-            ** replace all the references to pfns with the corresponding
-            ** mfns for the new domain.
-            **
-            ** On PAE we need to ensure that PGDs are in MFNs < 4G, and
-            ** so we may need to update the p2m after the main loop.
-            ** Hence we defer canonicalization of L1s until then.
-            */
-            if ((ctx->pt_levels != 3) ||
-                pae_extended_cr3 ||
-                (pagetype != XEN_DOMCTL_PFINFO_L1TAB)) {
-
-                if (!uncanonicalize_pagetable(xch, dom, ctx, page)) {
-                    /*
-                    ** Failing to uncanonicalize a page table can be ok
-                    ** under live migration since the pages type may have
-                    ** changed by now (and we'll get an update later).
-                    */
-                    DPRINTF("PT L%ld race on pfn=%08lx mfn=%08lx\n",
-                            pagetype >> 28, pfn, mfn);
-                    nraces++;
-                    continue;
-                }
-            }
-        }
-        else if ( pagetype != XEN_DOMCTL_PFINFO_NOTAB )
-        {
-            ERROR("Bogus page type %lx page table is out of range: "
-                  "i=%d p2m_size=%lu", pagetype, i, dinfo->p2m_size);
-            goto err_mapped;
-        }
-
-        if ( pagebuf->verify )
-        {
-            int res = memcmp(buf, (region_base + i*PAGE_SIZE), PAGE_SIZE);
-            if ( res )
-            {
-                int v;
-
-                DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx "
-                        "actualcs=%08lx\n", pfn, pfn_type[pfn],
-                        csum_page(region_base + i * PAGE_SIZE),
-                        csum_page(buf));
-
-                for ( v = 0; v < 4; v++ )
-                {
-                    unsigned long *p = (unsigned long *)
-                        (region_base + i*PAGE_SIZE);
-                    if ( buf[v] != p[v] )
-                        DPRINTF("    %d: %08lx %08lx\n", v, buf[v], p[v]);
-                }
-            }
-        }
-
-        if ( !ctx->hvm &&
-             xc_add_mmu_update(xch, mmu,
-                               (((unsigned long long)mfn) << PAGE_SHIFT)
-                               | MMU_MACHPHYS_UPDATE, pfn) )
-        {
-            PERROR("failed machpys update mfn=%lx pfn=%lx", mfn, pfn);
-            goto err_mapped;
-        }
-    } /* end of 'batch' for loop */
-
-    rc = nraces;
-    *invalid_pages += local_invalid_pages;
-
-  err_mapped:
-    munmap(region_base, j*PAGE_SIZE);
-    free(pfn_err);
-
-    return rc;
-}
-
-int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
-                      unsigned int store_evtchn, unsigned long *store_mfn,
-                      domid_t store_domid, unsigned int console_evtchn,
-                      unsigned long *console_mfn, domid_t console_domid,
-                      unsigned int hvm, unsigned int pae, int superpages,
-                      int checkpointed_stream,
-                      struct restore_callbacks *callbacks)
-{
-    DECLARE_DOMCTL;
-    xc_dominfo_t info;
-    int rc = 1, frc, i, j, n, m, pae_extended_cr3 = 0, ext_vcpucontext = 0;
-    uint32_t vcpuextstate_size = 0;
-    unsigned long mfn, pfn;
-    int nraces = 0;
-
-    /* The new domain's shared-info frame number. */
-    unsigned long shared_info_frame;
-    unsigned char shared_info_page[PAGE_SIZE]; /* saved contents from file */
-    shared_info_any_t *old_shared_info = 
-        (shared_info_any_t *)shared_info_page;
-    shared_info_any_t *new_shared_info;
-
-    /* A copy of the CPU context of the guest. */
-    DECLARE_HYPERCALL_BUFFER(vcpu_guest_context_any_t, ctxt);
-
-    /* A copy of the CPU eXtended States of the guest. */
-    DECLARE_HYPERCALL_BUFFER(void, buffer);
-
-    /* A table containing the type of each PFN (/not/ MFN!). */
-    unsigned long *pfn_type = NULL;
-
-    /* A table of MFNs to map in the current region */
-    xen_pfn_t *region_mfn = NULL;
-
-    /* A copy of the pfn-to-mfn table frame list. */
-    xen_pfn_t *p2m_frame_list = NULL;
-    
-    /* A temporary mapping of the guest's start_info page. */
-    start_info_any_t *start_info;
-
-    /* Our mapping of the current region (batch) */
-    char *region_base;
-
-    struct xc_mmu *mmu = NULL;
-
-    struct mmuext_op pin[MAX_PIN_BATCH];
-    unsigned int nr_pins;
-
-    uint64_t vcpumap[XC_SR_MAX_VCPUS/64] = { 1ULL };
-    unsigned int max_vcpu_id = 0;
-    int new_ctxt_format = 0;
-
-    pagebuf_t pagebuf;
-    tailbuf_t tailbuf, tmptail;
-    struct toolstack_data_t tdata, tdatatmp;
-    void* vcpup;
-    uint64_t console_pfn = 0;
-
-    int orig_io_fd_flags;
-
-    struct restore_ctx _ctx;
-    struct restore_ctx *ctx = &_ctx;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    if ( getenv("XG_MIGRATION_V2") )
-    {
-        return xc_domain_restore2(
-            xch, io_fd, dom, store_evtchn, store_mfn,
-            store_domid, console_evtchn, console_mfn, console_domid,
-            hvm,  pae,  superpages, checkpointed_stream, callbacks);
-    }
-
-    DPRINTF("%s: starting restore of new domid %u", __func__, dom);
-
-    pagebuf_init(&pagebuf);
-    memset(&tailbuf, 0, sizeof(tailbuf));
-    tailbuf.ishvm = hvm;
-    memset(&tdata, 0, sizeof(tdata));
-
-    memset(ctx, 0, sizeof(*ctx));
-
-    ctx->superpages = superpages;
-    ctx->hvm = hvm;
-    ctx->last_checkpoint = !checkpointed_stream;
-
-    ctxt = xc_hypercall_buffer_alloc(xch, ctxt, sizeof(*ctxt));
-
-    if ( ctxt == NULL )
-    {
-        PERROR("Unable to allocate VCPU ctxt buffer");
-        return 1;
-    }
-
-
-    if ( (orig_io_fd_flags = fcntl(io_fd, F_GETFL, 0)) < 0 ) {
-        PERROR("unable to read IO FD flags");
-        goto out;
-    }
-
-    if ( RDEXACT(io_fd, &dinfo->p2m_size, sizeof(unsigned long)) )
-    {
-        PERROR("read: p2m_size");
-        goto out;
-    }
-    DPRINTF("%s: p2m_size = %lx\n", __func__, dinfo->p2m_size);
-
-    if ( !get_platform_info(xch, dom,
-                            &ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) )
-    {
-        ERROR("Unable to get platform info.");
-        return 1;
-    }
-    
-    /* The *current* word size of the guest isn't very interesting; for now
-     * assume the guest will be the same as we are.  We'll fix that later
-     * if we discover otherwise. */
-    dinfo->guest_width = sizeof(unsigned long);
-    ctx->pt_levels = (dinfo->guest_width == 8) ? 4 : 3;
-    
-    if ( !hvm ) 
-    {
-        /* Load the p2m frame list, plus potential extended info chunk */
-        p2m_frame_list = load_p2m_frame_list(xch, ctx,
-            io_fd, &pae_extended_cr3, &ext_vcpucontext,
-            &vcpuextstate_size);
-
-        if ( !p2m_frame_list )
-            goto out;
-
-        /* Now that we know the word size, tell Xen about it */
-        memset(&domctl, 0, sizeof(domctl));
-        domctl.domain = dom;
-        domctl.cmd    = XEN_DOMCTL_set_address_size;
-        domctl.u.address_size.size = dinfo->guest_width * 8;
-        frc = do_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Unable to set guest address size.");
-            goto out;
-        }
-    }
-
-    /* We want zeroed memory so use calloc rather than malloc. */
-    ctx->p2m   = calloc(dinfo->p2m_size, sizeof(xen_pfn_t));
-    pfn_type   = calloc(dinfo->p2m_size, sizeof(unsigned long));
-
-    region_mfn = malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-    ctx->p2m_batch = malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-    if (!ctx->hvm && ctx->superpages)
-    {
-        ctx->p2m_saved_batch =
-            malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-        if ( ctx->p2m_saved_batch == NULL )
-        {
-            ERROR("saved batch memory alloc failed");
-            errno = ENOMEM;
-            goto out;
-        }
-    }
-
-    if ( (ctx->p2m == NULL) || (pfn_type == NULL) ||
-         (region_mfn == NULL) || (ctx->p2m_batch == NULL) )
-    {
-        ERROR("memory alloc failed");
-        errno = ENOMEM;
-        goto out;
-    }
-
-    memset(region_mfn, 0,
-           ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT)); 
-    memset(ctx->p2m_batch, 0,
-           ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT)); 
-
-    /* Get the domain's shared-info frame. */
-    if ( xc_domain_getinfo(xch, (domid_t)dom, 1, &info) != 1 )
-    {
-        PERROR("Could not get information on new domain");
-        goto out;
-    }
-    shared_info_frame = info.shared_info_frame;
-
-    /* Mark all PFNs as invalid; we allocate on demand */
-    for ( pfn = 0; pfn < dinfo->p2m_size; pfn++ )
-        ctx->p2m[pfn] = INVALID_P2M_ENTRY;
-
-    mmu = xc_alloc_mmu_updates(xch, dom);
-    if ( mmu == NULL )
-    {
-        PERROR("Could not initialise for MMU updates");
-        goto out;
-    }
-
-    xc_set_progress_prefix(xch, "Reloading memory pages");
-    xc_report_progress_step(xch, 0, dinfo->p2m_size);
-
-    /*
-     * Now simply read each saved frame into its new machine frame.
-     * We uncanonicalise page tables as we go.
-     */
-
-    n = m = 0;
- loadpages:
-    for ( ; ; )
-    {
-        int j, curbatch, invalid_pages;
-
-        xc_report_progress_step(xch, n, dinfo->p2m_size);
-
-        if ( !ctx->completed ) {
-            pagebuf.nr_physpages = pagebuf.nr_pages = 0;
-            pagebuf.compbuf_pos = pagebuf.compbuf_size = 0;
-            if ( pagebuf_get_one(xch, ctx, &pagebuf, io_fd, dom) < 0 ) {
-                PERROR("Error when reading batch");
-                goto out;
-            }
-        }
-        j = pagebuf.nr_pages;
-
-        DBGPRINTF("batch %d\n",j);
-
-        if ( j == 0 ) {
-            /* catch vcpu updates */
-            if (pagebuf.new_ctxt_format) {
-                max_vcpu_id = pagebuf.max_vcpu_id;
-                memcpy(vcpumap, pagebuf.vcpumap, vcpumap_sz(max_vcpu_id));
-            }
-            /* should this be deferred? does it change? */
-            if ( pagebuf.identpt )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT, pagebuf.identpt);
-            if ( pagebuf.paging_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_PAGING_RING_PFN, pagebuf.paging_ring_pfn);
-            if ( pagebuf.monitor_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_MONITOR_RING_PFN, pagebuf.monitor_ring_pfn);
-            if ( pagebuf.sharing_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_SHARING_RING_PFN, pagebuf.sharing_ring_pfn);
-            if ( pagebuf.vm86_tss )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
-            if ( pagebuf.console_pfn )
-                console_pfn = pagebuf.console_pfn;
-            if ( pagebuf.vm_generationid_addr )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_VM_GENERATION_ID_ADDR,
-                                 pagebuf.vm_generationid_addr);
-
-            break;  /* our work here is done */
-        }
-
-        /* break pagebuf into batches */
-        curbatch = 0;
-        invalid_pages = 0;
-        while ( curbatch < j ) {
-            int brc;
-
-            brc = apply_batch(xch, dom, ctx, region_mfn, pfn_type,
-                              pae_extended_cr3, mmu, &pagebuf, curbatch,
-                              &invalid_pages);
-            if ( brc < 0 )
-                goto out;
-
-            nraces += brc;
-
-            curbatch += MAX_BATCH_SIZE;
-        }
-
-        pagebuf.nr_physpages = pagebuf.nr_pages = 0;
-        pagebuf.compbuf_pos = pagebuf.compbuf_size = 0;
-
-        n += j; /* crude stats */
-
-        /* 
-         * Discard cache for portion of file read so far up to last
-         *  page boundary every 16MB or so.
-         */
-        m += j;
-        if ( m > MAX_PAGECACHE_USAGE )
-        {
-            discard_file_cache(xch, io_fd, 0 /* no flush */);
-            m = 0;
-        }
-    }
-
-    /*
-     * Ensure we flush all machphys updates before potential PAE-specific
-     * reallocations below.
-     */
-    if ( !hvm && xc_flush_mmu_updates(xch, mmu) )
-    {
-        PERROR("Error doing flush_mmu_updates()");
-        goto out;
-    }
-
-    // DPRINTF("Received all pages (%d races)\n", nraces);
-
-    if ( !ctx->completed ) {
-
-        if ( buffer_tail(xch, ctx, &tailbuf, io_fd, max_vcpu_id, vcpumap,
-                         ext_vcpucontext, vcpuextstate_size) < 0 ) {
-            ERROR ("error buffering image tail");
-            goto out;
-        }
-
-        ctx->completed = 1;
-
-        /*
-         * If more checkpoints are expected then shift into
-         * nonblocking mode for the remainder.
-         */
-        if ( !ctx->last_checkpoint )
-            fcntl(io_fd, F_SETFL, orig_io_fd_flags | O_NONBLOCK);
-
-        /*
-         * If sender had sent enable compression flag, switch to compressed
-         * checkpoints mode once the first checkpoint is received.
-         */
-        if (ctx->compressing)
-            pagebuf.compressing = 1;
-    }
-
-    if (pagebuf.viridian != 0)
-        xc_hvm_param_set(xch, dom, HVM_PARAM_VIRIDIAN, pagebuf.viridian);
-
-    /*
-     * If we are migrating in from a host that does not support
-     * secondary emulators then nr_ioreq_server_pages will be 0, since
-     * there will be no XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk in
-     * the image.
-     * If we are migrating from a host that does support secondary
-     * emulators then the XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk
-     * will exist and is guaranteed to have a non-zero value. The
-     * existence of that chunk also implies the existence of the
-     * XC_SAVE_ID_HVM_IOREQ_SERVER_PFN chunk, which is also guaranteed
-     * to have a non-zero value.
-     */
-    if (!pagebuf.nr_ioreq_server_pages ^ !pagebuf.ioreq_server_pfn) {
-        ERROR("Inconsistent IOREQ Server settings (nr=%"PRIx64", pfn=%"PRIx64")",
-              pagebuf.nr_ioreq_server_pages, pagebuf.ioreq_server_pfn);
-    } else {
-        if (pagebuf.nr_ioreq_server_pages != 0 &&
-            pagebuf.ioreq_server_pfn != 0) {
-            xc_hvm_param_set(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
-                             pagebuf.nr_ioreq_server_pages);
-            xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
-                             pagebuf.ioreq_server_pfn);
-        }
-    }
-
-    if (pagebuf.acpi_ioport_location == 1) {
-        DBGPRINTF("Use new firmware ioport from the checkpoint\n");
-        xc_hvm_param_set(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
-    } else if (pagebuf.acpi_ioport_location == 0) {
-        DBGPRINTF("Use old firmware ioport from the checkpoint\n");
-    } else {
-        ERROR("Error, unknow acpi ioport location (%"PRId64")", pagebuf.acpi_ioport_location);
-    }
-
-    tdatatmp = tdata;
-    tdata = pagebuf.tdata;
-    pagebuf.tdata = tdatatmp;
-
-    if ( ctx->last_checkpoint )
-    {
-        // DPRINTF("Last checkpoint, finishing\n");
-        goto finish;
-    }
-
-    // DPRINTF("Buffered checkpoint\n");
-
-    if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
-        PERROR("error when buffering batch, finishing");
-        /*
-         * Remus: discard the current incomplete checkpoint and restore
-         * backup from the last complete checkpoint.
-         */
-        goto finish;
-    }
-    memset(&tmptail, 0, sizeof(tmptail));
-    tmptail.ishvm = hvm;
-    if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
-                     ext_vcpucontext, vcpuextstate_size) < 0 ) {
-        ERROR ("error buffering image tail, finishing");
-        /*
-         * Remus: discard the current incomplete checkpoint and restore
-         * backup from the last complete checkpoint.
-         */
-        goto finish;
-    }
-    tailbuf_free(&tailbuf);
-    memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
-
-    goto loadpages;
-
-  /* With Remus: restore from last complete checkpoint */
-  finish:
-    if ( hvm )
-        goto finish_hvm;
-
-    if ( (ctx->pt_levels == 3) && !pae_extended_cr3 )
-    {
-        /*
-        ** XXX SMH on PAE we need to ensure PGDs are in MFNs < 4G. This
-        ** is a little awkward and involves (a) finding all such PGDs and
-        ** replacing them with 'lowmem' versions; (b) upating the p2m[]
-        ** with the new info; and (c) canonicalizing all the L1s using the
-        ** (potentially updated) p2m[].
-        **
-        ** This is relatively slow (and currently involves two passes through
-        ** the pfn_type[] array), but at least seems to be correct. May wish
-        ** to consider more complex approaches to optimize this later.
-        */
-
-        int j, k;
-        
-        /* First pass: find all L3TABs current in > 4G mfns and get new mfns */
-        for ( i = 0; i < dinfo->p2m_size; i++ )
-        {
-            if ( ((pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ==
-                  XEN_DOMCTL_PFINFO_L3TAB) &&
-                 (ctx->p2m[i] > 0xfffffUL) )
-            {
-                unsigned long new_mfn;
-                uint64_t l3ptes[4];
-                uint64_t *l3tab;
-
-                l3tab = (uint64_t *)
-                    xc_map_foreign_range(xch, dom, PAGE_SIZE,
-                                         PROT_READ, ctx->p2m[i]);
-                if ( l3tab == NULL )
-                {
-                    PERROR("xc_map_foreign_range failed (for l3tab)");
-                    goto out;
-                }
-
-                for ( j = 0; j < 4; j++ )
-                    l3ptes[j] = l3tab[j];
-
-                munmap(l3tab, PAGE_SIZE);
-
-                new_mfn = xc_make_page_below_4G(xch, dom, ctx->p2m[i]);
-                if ( !new_mfn )
-                {
-                    PERROR("Couldn't get a page below 4GB :-(");
-                    goto out;
-                }
-
-                ctx->p2m[i] = new_mfn;
-                if ( xc_add_mmu_update(xch, mmu,
-                                       (((unsigned long long)new_mfn)
-                                        << PAGE_SHIFT) |
-                                       MMU_MACHPHYS_UPDATE, i) )
-                {
-                    PERROR("Couldn't m2p on PAE root pgdir");
-                    goto out;
-                }
-
-                l3tab = (uint64_t *)
-                    xc_map_foreign_range(xch, dom, PAGE_SIZE,
-                                         PROT_READ | PROT_WRITE, ctx->p2m[i]);
-                if ( l3tab == NULL )
-                {
-                    PERROR("xc_map_foreign_range failed (for l3tab, 2nd)");
-                    goto out;
-                }
-
-                for ( j = 0; j < 4; j++ )
-                    l3tab[j] = l3ptes[j];
-
-                munmap(l3tab, PAGE_SIZE);
-            }
-        }
-
-        /* Second pass: find all L1TABs and uncanonicalize them */
-        j = 0;
-
-        for ( i = 0; i < dinfo->p2m_size; i++ )
-        {
-            if ( ((pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ==
-                  XEN_DOMCTL_PFINFO_L1TAB) )
-            {
-                region_mfn[j] = ctx->p2m[i];
-                j++;
-            }
-
-            if ( (i == (dinfo->p2m_size-1)) || (j == MAX_BATCH_SIZE) )
-            {
-                region_base = xc_map_foreign_pages(
-                    xch, dom, PROT_READ | PROT_WRITE, region_mfn, j);
-                if ( region_base == NULL )
-                {
-                    PERROR("map batch failed");
-                    goto out;
-                }
-
-                for ( k = 0; k < j; k++ )
-                {
-                    if ( !uncanonicalize_pagetable(
-                        xch, dom, ctx,
-                        region_base + k*PAGE_SIZE) )
-                    {
-                        ERROR("failed uncanonicalize pt!");
-                        goto out;
-                    }
-                }
-
-                munmap(region_base, j*PAGE_SIZE);
-                j = 0;
-            }
-        }
-
-        if ( xc_flush_mmu_updates(xch, mmu) )
-        {
-            PERROR("Error doing xc_flush_mmu_updates()");
-            goto out;
-        }
-    }
-
-    /*
-     * Pin page tables. Do this after writing to them as otherwise Xen
-     * will barf when doing the type-checking.
-     */
-    nr_pins = 0;
-    for ( i = 0; i < dinfo->p2m_size; i++ )
-    {
-        if ( (pfn_type[i] & XEN_DOMCTL_PFINFO_LPINTAB) == 0 )
-            continue;
-
-        switch ( pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK )
-        {
-        case XEN_DOMCTL_PFINFO_L1TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L2TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L3TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L3_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L4TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L4_TABLE;
-            break;
-
-        default:
-            continue;
-        }
-
-        pin[nr_pins].arg1.mfn = ctx->p2m[i];
-        nr_pins++;
-
-        /* Batch full? Then flush. */
-        if ( nr_pins == MAX_PIN_BATCH )
-        {
-            if ( xc_mmuext_op(xch, pin, nr_pins, dom) < 0 )
-            {
-                PERROR("Failed to pin batch of %d page tables", nr_pins);
-                goto out;
-            }
-            nr_pins = 0;
-        }
-    }
-
-    /* Flush final partial batch. */
-    if ( (nr_pins != 0) && (xc_mmuext_op(xch, pin, nr_pins, dom) < 0) )
-    {
-        PERROR("Failed to pin batch of %d page tables", nr_pins);
-        goto out;
-    }
-
-    DPRINTF("Memory reloaded (%ld pages)\n", ctx->nr_pfns);
-
-    /* Get the list of PFNs that are not in the psuedo-phys map */
-    {
-        int nr_frees = 0;
-
-        for ( i = 0; i < tailbuf.u.pv.pfncount; i++ )
-        {
-            unsigned long pfn = tailbuf.u.pv.pfntab[i];
-
-            if ( ctx->p2m[pfn] != INVALID_P2M_ENTRY )
-            {
-                /* pfn is not in physmap now, but was at some point during
-                   the save/migration process - need to free it */
-                tailbuf.u.pv.pfntab[nr_frees++] = ctx->p2m[pfn];
-                ctx->p2m[pfn]  = INVALID_P2M_ENTRY; /* not in pseudo-physical map */
-            }
-        }
-
-        if ( nr_frees > 0 )
-        {
-            if ( (frc = xc_domain_decrease_reservation(xch, dom, nr_frees, 0, tailbuf.u.pv.pfntab)) != nr_frees )
-            {
-                PERROR("Could not decrease reservation : %d", frc);
-                goto out;
-            }
-            else
-                DPRINTF("Decreased reservation by %d pages\n", tailbuf.u.pv.pfncount);
-        }
-    }
-
-    vcpup = tailbuf.u.pv.vcpubuf;
-    for ( i = 0; i <= max_vcpu_id; i++ )
-    {
-        if ( !(vcpumap[i/64] & (1ULL << (i%64))) )
-            continue;
-
-        memcpy(ctxt, vcpup, ((dinfo->guest_width == 8) ? sizeof(ctxt->x64)
-                              : sizeof(ctxt->x32)));
-        vcpup += (dinfo->guest_width == 8) ? sizeof(ctxt->x64) : sizeof(ctxt->x32);
-
-        DPRINTF("read VCPU %d\n", i);
-
-        if ( !new_ctxt_format )
-            SET_FIELD(ctxt, flags,
-                      GET_FIELD(ctxt, flags, dinfo->guest_width) | VGCF_online,
-                      dinfo->guest_width);
-
-        if ( i == 0 )
-        {
-            /*
-             * Uncanonicalise the start info frame number and poke in
-             * updated values into the start info itself.
-             *
-             * The start info MFN is the 3rd argument to the
-             * HYPERVISOR_sched_op hypercall when op==SCHEDOP_shutdown
-             * and reason==SHUTDOWN_suspend, it is canonicalised in
-             * xc_domain_save and therefore the PFN is found in the
-             * edx register.
-             */
-            pfn = GET_FIELD(ctxt, user_regs.edx, dinfo->guest_width);
-            if ( (pfn >= dinfo->p2m_size) ||
-                 (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-            {
-                ERROR("Suspend record frame number is bad");
-                goto out;
-            }
-            mfn = ctx->p2m[pfn];
-            SET_FIELD(ctxt, user_regs.edx, mfn, dinfo->guest_width);
-            start_info = xc_map_foreign_range(
-                xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, mfn);
-            if ( start_info == NULL )
-            {
-                PERROR("xc_map_foreign_range failed (for start_info)");
-                goto out;
-            }
-
-            SET_FIELD(start_info, nr_pages, dinfo->p2m_size, dinfo->guest_width);
-            SET_FIELD(start_info, shared_info, shared_info_frame<<PAGE_SHIFT, dinfo->guest_width);
-            SET_FIELD(start_info, flags, 0, dinfo->guest_width);
-            if ( GET_FIELD(start_info, store_mfn, dinfo->guest_width) > dinfo->p2m_size )
-            {
-                ERROR("Suspend record xenstore frame number is bad");
-                munmap(start_info, PAGE_SIZE);
-                goto out;
-            }
-            *store_mfn = ctx->p2m[GET_FIELD(start_info, store_mfn, dinfo->guest_width)];
-            SET_FIELD(start_info, store_mfn, *store_mfn, dinfo->guest_width);
-            SET_FIELD(start_info, store_evtchn, store_evtchn, dinfo->guest_width);
-            if ( GET_FIELD(start_info, console.domU.mfn, dinfo->guest_width) > dinfo->p2m_size )
-            {
-                ERROR("Suspend record console frame number is bad");
-                munmap(start_info, PAGE_SIZE);
-                goto out;
-            }
-            *console_mfn = ctx->p2m[GET_FIELD(start_info, console.domU.mfn, dinfo->guest_width)];
-            SET_FIELD(start_info, console.domU.mfn, *console_mfn, dinfo->guest_width);
-            SET_FIELD(start_info, console.domU.evtchn, console_evtchn, dinfo->guest_width);
-            munmap(start_info, PAGE_SIZE);
-        }
-        /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents, dinfo->guest_width) > 8192 )
-        {
-            ERROR("GDT entry count out of range");
-            goto out;
-        }
-
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents, dinfo->guest_width); j++ )
-        {
-            pfn = GET_FIELD(ctxt, gdt_frames[j], dinfo->guest_width);
-            if ( (pfn >= dinfo->p2m_size) ||
-                 (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-            {
-                ERROR("GDT frame number %i (0x%lx) is bad", 
-                      j, (unsigned long)pfn);
-                goto out;
-            }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn], dinfo->guest_width);
-        }
-        /* Uncanonicalise the page table base pointer. */
-        pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3], dinfo->guest_width));
-
-        if ( pfn >= dinfo->p2m_size )
-        {
-            ERROR("PT base is bad: pfn=%lu p2m_size=%lu type=%08lx",
-                  pfn, dinfo->p2m_size, pfn_type[pfn]);
-            goto out;
-        }
-
-        if ( (pfn_type[pfn] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) !=
-             ((unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT) )
-        {
-            ERROR("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx",
-                  pfn, dinfo->p2m_size, pfn_type[pfn],
-                  (unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT);
-            goto out;
-        }
-        SET_FIELD(ctxt, ctrlreg[3], FOLD_CR3(ctx->p2m[pfn]), dinfo->guest_width);
-
-        /* Guest pagetable (x86/64) stored in otherwise-unused CR1. */
-        if ( (ctx->pt_levels == 4) && (ctxt->x64.ctrlreg[1] & 1) )
-        {
-            pfn = UNFOLD_CR3(ctxt->x64.ctrlreg[1] & ~1);
-            if ( pfn >= dinfo->p2m_size )
-            {
-                ERROR("User PT base is bad: pfn=%lu p2m_size=%lu",
-                      pfn, dinfo->p2m_size);
-                goto out;
-            }
-            if ( (pfn_type[pfn] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) !=
-                 ((unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT) )
-            {
-                ERROR("User PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx",
-                      pfn, dinfo->p2m_size, pfn_type[pfn],
-                      (unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT);
-                goto out;
-            }
-            ctxt->x64.ctrlreg[1] = FOLD_CR3(ctx->p2m[pfn]);
-        }
-        frc = xc_vcpu_setcontext(xch, dom, i, ctxt);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't build vcpu%d", i);
-            goto out;
-        }
-
-        if ( !ext_vcpucontext )
-            goto vcpu_ext_state_restore;
-        memcpy(&domctl.u.ext_vcpucontext, vcpup, 128);
-        vcpup += 128;
-        domctl.cmd = XEN_DOMCTL_set_ext_vcpucontext;
-        domctl.domain = dom;
-        frc = xc_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't set extended vcpu%d info", i);
-            goto out;
-        }
-
- vcpu_ext_state_restore:
-        if ( !vcpuextstate_size )
-            continue;
-
-        memcpy(&domctl.u.vcpuextstate.xfeature_mask, vcpup,
-               sizeof(domctl.u.vcpuextstate.xfeature_mask));
-        vcpup += sizeof(domctl.u.vcpuextstate.xfeature_mask);
-        memcpy(&domctl.u.vcpuextstate.size, vcpup,
-               sizeof(domctl.u.vcpuextstate.size));
-        vcpup += sizeof(domctl.u.vcpuextstate.size);
-
-        buffer = xc_hypercall_buffer_alloc(xch, buffer,
-                                           domctl.u.vcpuextstate.size);
-        if ( !buffer )
-        {
-            PERROR("Could not allocate buffer to restore eXtended States");
-            goto out;
-        }
-        memcpy(buffer, vcpup, domctl.u.vcpuextstate.size);
-        vcpup += domctl.u.vcpuextstate.size;
-
-        domctl.cmd = XEN_DOMCTL_setvcpuextstate;
-        domctl.domain = dom;
-        domctl.u.vcpuextstate.vcpu = i;
-        set_xen_guest_handle(domctl.u.vcpuextstate.buffer, buffer);
-        frc = xc_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't set eXtended States for vcpu%d", i);
-            goto out;
-        }
-        xc_hypercall_buffer_free(xch, buffer);
-    }
-
-    memcpy(shared_info_page, tailbuf.u.pv.shared_info_page, PAGE_SIZE);
-
-    DPRINTF("Completed checkpoint load\n");
-
-    /* Restore contents of shared-info page. No checking needed. */
-    new_shared_info = xc_map_foreign_range(
-        xch, dom, PAGE_SIZE, PROT_WRITE, shared_info_frame);
-    if ( new_shared_info == NULL )
-    {
-        PERROR("xc_map_foreign_range failed (for new_shared_info)");
-        goto out;
-    }
-
-    /* restore saved vcpu_info and arch specific info */
-    MEMCPY_FIELD(new_shared_info, old_shared_info, vcpu_info, dinfo->guest_width);
-    MEMCPY_FIELD(new_shared_info, old_shared_info, arch, dinfo->guest_width);
-
-    /* clear any pending events and the selector */
-    MEMSET_ARRAY_FIELD(new_shared_info, evtchn_pending, 0, dinfo->guest_width);
-    for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
-	    SET_FIELD(new_shared_info, vcpu_info[i].evtchn_pending_sel, 0, dinfo->guest_width);
-
-    /* mask event channels */
-    MEMSET_ARRAY_FIELD(new_shared_info, evtchn_mask, 0xff, dinfo->guest_width);
-
-    /* leave wallclock time. set by hypervisor */
-    munmap(new_shared_info, PAGE_SIZE);
-
-    /* Uncanonicalise the pfn-to-mfn table frame-number list. */
-    for ( i = 0; i < P2M_FL_ENTRIES; i++ )
-    {
-        pfn = p2m_frame_list[i];
-        if ( (pfn >= dinfo->p2m_size) || (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-        {
-            ERROR("PFN-to-MFN frame number %i (%#lx) is bad", i, pfn);
-            goto out;
-        }
-        p2m_frame_list[i] = ctx->p2m[pfn];
-    }
-
-    /* Copy the P2M we've constructed to the 'live' P2M */
-    if ( !(ctx->live_p2m = xc_map_foreign_pages(xch, dom, PROT_WRITE,
-                                           p2m_frame_list, P2M_FL_ENTRIES)) )
-    {
-        PERROR("Couldn't map p2m table");
-        goto out;
-    }
-
-    /* If the domain we're restoring has a different word size to ours,
-     * we need to adjust the live_p2m assignment appropriately */
-    if ( dinfo->guest_width > sizeof (xen_pfn_t) )
-        for ( i = dinfo->p2m_size - 1; i >= 0; i-- )
-            ((int64_t *)ctx->live_p2m)[i] = (long)ctx->p2m[i];
-    else if ( dinfo->guest_width < sizeof (xen_pfn_t) )
-        for ( i = 0; i < dinfo->p2m_size; i++ )   
-            ((uint32_t *)ctx->live_p2m)[i] = ctx->p2m[i];
-    else
-        memcpy(ctx->live_p2m, ctx->p2m, dinfo->p2m_size * sizeof(xen_pfn_t));
-    munmap(ctx->live_p2m, P2M_FL_ENTRIES * PAGE_SIZE);
-
-    frc = xc_dom_gnttab_seed(xch, dom, *console_mfn, *store_mfn,
-                             console_domid, store_domid);
-    if (frc != 0)
-    {
-        ERROR("error seeding grant table");
-        goto out;
-    }
-
-    DPRINTF("Domain ready to be built.\n");
-    rc = 0;
-    goto out;
-
-  finish_hvm:
-    if ( tdata.data != NULL )
-    {
-        if ( callbacks != NULL && callbacks->toolstack_restore != NULL )
-        {
-            frc = callbacks->toolstack_restore(dom, tdata.data, tdata.len,
-                                               callbacks->data);
-            free(tdata.data);
-            if ( frc < 0 )
-            {
-                PERROR("error calling toolstack_restore");
-                goto out;
-            }
-        } else {
-            rc = -1;
-            ERROR("toolstack data available but no callback provided\n");
-            free(tdata.data);
-            goto out;
-        }
-    }
-
-    /* Dump the QEMU state to a state file for QEMU to load */
-    if ( dump_qemu(xch, dom, &tailbuf.u.hvm) ) {
-        PERROR("Error dumping QEMU state to file");
-        goto out;
-    }
-
-    /* These comms pages need to be zeroed at the start of day */
-    if ( xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[0]) ||
-         xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[1]) ||
-         xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[2]) )
-    {
-        PERROR("error zeroing magic pages");
-        goto out;
-    }
-
-    if ( (frc = xc_hvm_param_set(xch, dom,
-                                 HVM_PARAM_IOREQ_PFN, tailbuf.u.hvm.magicpfns[0]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_BUFIOREQ_PFN, tailbuf.u.hvm.magicpfns[1]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_STORE_PFN, tailbuf.u.hvm.magicpfns[2]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_PAE_ENABLED, pae))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_CONSOLE_EVTCHN,
-                                    console_evtchn)) )
-    {
-        PERROR("error setting HVM params: %i", frc);
-        goto out;
-    }
-    *store_mfn = tailbuf.u.hvm.magicpfns[2];
-
-    if ( console_pfn ) {
-        if ( xc_clear_domain_page(xch, dom, console_pfn) ) {
-            PERROR("error zeroing console page");
-            goto out;
-        }
-        if ( (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_CONSOLE_PFN, console_pfn)) ) {
-            PERROR("error setting HVM param: %i", frc);
-            goto out;
-        }
-        *console_mfn = console_pfn;
-    }
-
-    frc = xc_domain_hvm_setcontext(xch, dom, tailbuf.u.hvm.hvmbuf,
-                                   tailbuf.u.hvm.reclen);
-    if ( frc )
-    {
-        PERROR("error setting the HVM context");
-        goto out;
-    }
-
-    frc = xc_dom_gnttab_hvm_seed(xch, dom, *console_mfn, *store_mfn,
-                                 console_domid, store_domid);
-    if (frc != 0)
-    {
-        ERROR("error seeding grant table");
-        goto out;
-    }
-
-    /* HVM success! */
-    rc = 0;
-
- out:
-    if ( (rc != 0) && (dom != 0) )
-        xc_domain_destroy(xch, dom);
-    xc_hypercall_buffer_free(xch, ctxt);
-    free(mmu);
-    free(ctx->p2m);
-    free(pfn_type);
-    free(region_mfn);
-    free(ctx->p2m_batch);
-    pagebuf_free(&pagebuf);
-    tailbuf_free(&tailbuf);
-
-    /* discard cache for save file  */
-    discard_file_cache(xch, io_fd, 1 /*flush*/);
-
-    fcntl(io_fd, F_SETFL, orig_io_fd_flags);
-
-    DPRINTF("Restore exit of domid %u with rc=%d\n", dom, rc);
-
-    return rc;
-}
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
deleted file mode 100644
index 3222473..0000000
--- a/tools/libxc/xc_domain_save.c
+++ /dev/null
@@ -1,2198 +0,0 @@
-/******************************************************************************
- * xc_linux_save.c
- *
- * Save the state of a running Linux session.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Copyright (c) 2003, K A Fraser.
- */
-
-#include <inttypes.h>
-#include <time.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <assert.h>
-
-#include "xc_private.h"
-#include "xc_bitops.h"
-#include "xc_dom.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
-
-#include <xen/hvm/params.h>
-
-/*
-** Default values for important tuning parameters. Can override by passing
-** non-zero replacement values to xc_domain_save().
-**
-** XXX SMH: should consider if want to be able to override MAX_MBIT_RATE too.
-**
-*/
-#define DEF_MAX_ITERS   29   /* limit us to 30 times round loop   */
-#define DEF_MAX_FACTOR   3   /* never send more than 3x p2m_size  */
-
-struct save_ctx {
-    unsigned long hvirt_start; /* virtual starting address of the hypervisor */
-    unsigned int pt_levels; /* #levels of page tables used by the current guest */
-    unsigned long max_mfn; /* max mfn of the whole machine */
-    xen_pfn_t *live_p2m; /* Live mapping of the table mapping each PFN to its current MFN. */
-    xen_pfn_t *live_m2p; /* Live mapping of system MFN to PFN table. */
-    unsigned long m2p_mfn0;
-    struct domain_info_context dinfo;
-};
-
-/* buffer for output */
-struct outbuf {
-    void* buf;
-    size_t size;
-    size_t pos;
-    int write_count;
-};
-
-#define OUTBUF_SIZE (16384 * 1024)
-
-/* grep fodder: machine_to_phys */
-
-#define mfn_to_pfn(_mfn)  (ctx->live_m2p[(_mfn)])
-
-#define pfn_to_mfn(_pfn)                                            \
-  ((xen_pfn_t) ((dinfo->guest_width==8)                               \
-                ? (((uint64_t *)ctx->live_p2m)[(_pfn)])                  \
-                : ((((uint32_t *)ctx->live_p2m)[(_pfn)]) == 0xffffffffU  \
-                   ? (-1UL) : (((uint32_t *)ctx->live_p2m)[(_pfn)]))))
-
-/*
- * Returns TRUE if the given machine frame number has a unique mapping
- * in the guest's pseudophysical map.
- */
-#define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn)          \
-    (((_mfn) < (ctx->max_mfn)) &&                \
-     ((mfn_to_pfn(_mfn) < (dinfo->p2m_size)) &&   \
-      (pfn_to_mfn(mfn_to_pfn(_mfn)) == (_mfn))))
-
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
-
-#define SUPER_PAGE_START(pfn)    (((pfn) & (SUPERPAGE_NR_PFNS-1)) == 0 )
-
-static uint64_t tv_to_us(struct timeval *new)
-{
-    return (new->tv_sec * 1000000) + new->tv_usec;
-}
-
-static uint64_t llgettimeofday(void)
-{
-    struct timeval now;
-    gettimeofday(&now, NULL);
-    return tv_to_us(&now);
-}
-
-static uint64_t tv_delta(struct timeval *new, struct timeval *old)
-{
-    return (((new->tv_sec - old->tv_sec)*1000000) +
-            (new->tv_usec - old->tv_usec));
-}
-
-static int noncached_write(xc_interface *xch,
-                           struct outbuf* ob,
-                           int fd, void *buffer, int len) 
-{
-    int rc = (write_exact(fd, buffer, len) == 0) ? len : -1;
-
-    ob->write_count += len;
-    if ( ob->write_count >= (MAX_PAGECACHE_USAGE * PAGE_SIZE) )
-    {
-        /* Time to discard cache - dont care if this fails */
-        int saved_errno = errno;
-        discard_file_cache(xch, fd, 0 /* no flush */);
-        errno = saved_errno;
-        ob->write_count = 0;
-    }
-
-    return rc;
-}
-
-static int outbuf_init(xc_interface *xch, struct outbuf* ob, size_t size)
-{
-    memset(ob, 0, sizeof(*ob));
-
-    if ( !(ob->buf = malloc(size)) ) {
-        DPRINTF("error allocating output buffer of size %zu\n", size);
-        return -1;
-    }
-
-    ob->size = size;
-
-    return 0;
-}
-
-static int outbuf_free(struct outbuf *ob)
-{
-    free(ob->buf);
-    ob->buf = NULL;
-    return 0;
-}
-
-static inline int outbuf_write(xc_interface *xch,
-                               struct outbuf* ob, void* buf, size_t len)
-{
-    if ( len > ob->size - ob->pos ) {
-        errno = ERANGE;
-        DBGPRINTF("outbuf_write: %zu > %zu@%zu\n", len, ob->size - ob->pos, ob->pos);
-        return -1;
-    }
-
-    memcpy(ob->buf + ob->pos, buf, len);
-    ob->pos += len;
-
-    return 0;
-}
-
-/* prep for nonblocking I/O */
-static int outbuf_flush(xc_interface *xch, struct outbuf* ob, int fd)
-{
-    int rc;
-    int cur = 0;
-
-    if ( !ob->pos )
-        return 0;
-
-    rc = write(fd, ob->buf, ob->pos);
-    while (rc < 0 || cur + rc < ob->pos) {
-        if (rc < 0 && errno != EAGAIN && errno != EINTR) {
-            DPRINTF("error flushing output: %d\n", errno);
-            return -1;
-        }
-        if (rc > 0)
-            cur += rc;
-
-        rc = write(fd, ob->buf + cur, ob->pos - cur);
-    }
-
-    ob->pos = 0;
-
-    return 0;
-}
-
-/* if there's no room in the buffer, flush it and try again. */
-static inline int outbuf_hardwrite(xc_interface *xch,
-                                   struct outbuf* ob, int fd, void* buf,
-                                   size_t len)
-{
-    if ( !len )
-        return 0;
-
-    if ( !outbuf_write(xch, ob, buf, len) )
-        return 0;
-
-    if ( outbuf_flush(xch, ob, fd) < 0 )
-        return -1;
-
-    return outbuf_write(xch, ob, buf, len);
-}
-
-/* start buffering output once we've reached checkpoint mode. */
-static inline int write_buffer(xc_interface *xch,
-                               int dobuf, struct outbuf* ob, int fd, void* buf,
-                               size_t len)
-{
-    if ( dobuf )
-        return outbuf_hardwrite(xch, ob, fd, buf, len);
-    else
-        return write_exact(fd, buf, len);
-}
-
-/* like write_buffer for noncached, which returns number of bytes written */
-static inline int write_uncached(xc_interface *xch,
-                                   int dobuf, struct outbuf* ob, int fd,
-                                   void* buf, size_t len)
-{
-    if ( dobuf )
-        return outbuf_hardwrite(xch, ob, fd, buf, len) ? -1 : len;
-    else
-        return noncached_write(xch, ob, fd, buf, len);
-}
-
-static int write_compressed(xc_interface *xch, comp_ctx *compress_ctx,
-                            int dobuf, struct outbuf* ob, int fd)
-{
-    int rc = 0;
-    int header = sizeof(int) + sizeof(unsigned long);
-    int marker = XC_SAVE_ID_COMPRESSED_DATA;
-    unsigned long compbuf_len = 0;
-
-    for(;;)
-    {
-        /* check for available space (atleast 8k) */
-        if ((ob->pos + header + XC_PAGE_SIZE * 2) > ob->size)
-        {
-            if (outbuf_flush(xch, ob, fd) < 0)
-            {
-                ERROR("Error when flushing outbuf intermediate");
-                return -1;
-            }
-        }
-
-        rc = xc_compression_compress_pages(xch, compress_ctx,
-                                           ob->buf + ob->pos + header,
-                                           ob->size - ob->pos - header,
-                                           &compbuf_len);
-        if (!rc)
-            break;
-
-        if (outbuf_hardwrite(xch, ob, fd, &marker, sizeof(marker)) < 0)
-        {
-            PERROR("Error when writing marker (errno %d)", errno);
-            return -1;
-        }
-
-        if (outbuf_hardwrite(xch, ob, fd, &compbuf_len, sizeof(compbuf_len)) < 0)
-        {
-            PERROR("Error when writing compbuf_len (errno %d)", errno);
-            return -1;
-        }
-
-        ob->pos += (size_t) compbuf_len;
-        if (!dobuf && outbuf_flush(xch, ob, fd) < 0)
-        {
-            ERROR("Error when writing compressed chunk");
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-struct time_stats {
-    struct timeval wall;
-    long long d0_cpu, d1_cpu;
-};
-
-static int print_stats(xc_interface *xch, uint32_t domid, int pages_sent,
-                       struct time_stats *last,
-                       xc_shadow_op_stats_t *stats, int print)
-{
-    struct time_stats now;
-
-    gettimeofday(&now.wall, NULL);
-
-    now.d0_cpu = xc_domain_get_cpu_usage(xch, 0, /* FIXME */ 0)/1000;
-    now.d1_cpu = xc_domain_get_cpu_usage(xch, domid, /* FIXME */ 0)/1000;
-
-    if ( (now.d0_cpu == -1) || (now.d1_cpu == -1) )
-        DPRINTF("ARRHHH!!\n");
-
-    if ( print )
-    {
-        long long wall_delta;
-        long long d0_cpu_delta;
-        long long d1_cpu_delta;
-
-        wall_delta = tv_delta(&now.wall,&last->wall)/1000;
-        if ( wall_delta == 0 )
-            wall_delta = 1;
-
-        d0_cpu_delta = (now.d0_cpu - last->d0_cpu)/1000;
-        d1_cpu_delta = (now.d1_cpu - last->d1_cpu)/1000;
-
-        DPRINTF("delta %lldms, dom0 %d%%, target %d%%, sent %dMb/s, "
-                "dirtied %dMb/s %" PRId32 " pages\n",
-                wall_delta,
-                (int)((d0_cpu_delta*100)/wall_delta),
-                (int)((d1_cpu_delta*100)/wall_delta),
-                (int)((pages_sent*PAGE_SIZE)/(wall_delta*(1000/8))),
-                (int)((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8))),
-                stats->dirty_count);
-    }
-
-    *last = now;
-
-    return 0;
-}
-
-
-static int analysis_phase(xc_interface *xch, uint32_t domid, struct save_ctx *ctx,
-                          xc_hypercall_buffer_t *arr, int runs)
-{
-    long long start, now;
-    xc_shadow_op_stats_t stats;
-    int j;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    start = llgettimeofday();
-
-    for ( j = 0; j < runs; j++ )
-    {
-        int i;
-
-        xc_shadow_control(xch, domid, XEN_DOMCTL_SHADOW_OP_CLEAN,
-                          arr, dinfo->p2m_size, NULL, 0, NULL);
-        DPRINTF("#Flush\n");
-        for ( i = 0; i < 40; i++ )
-        {
-            usleep(50000);
-            now = llgettimeofday();
-            xc_shadow_control(xch, domid, XEN_DOMCTL_SHADOW_OP_PEEK,
-                              NULL, 0, NULL, 0, &stats);
-            DPRINTF("now= %lld faults= %"PRId32" dirty= %"PRId32"\n",
-                    ((now-start)+500)/1000,
-                    stats.fault_count, stats.dirty_count);
-        }
-    }
-
-    return -1;
-}
-
-static int suspend_and_state(int (*suspend)(void*), void* data,
-                             xc_interface *xch, int io_fd, int dom,
-                             xc_dominfo_t *info)
-{
-    if ( !(*suspend)(data) )
-    {
-        ERROR("Suspend request failed");
-        return -1;
-    }
-
-    if ( (xc_domain_getinfo(xch, dom, 1, info) != 1) ||
-         !info->shutdown || (info->shutdown_reason != SHUTDOWN_suspend) )
-    {
-        ERROR("Domain not in suspended state");
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
-** Map the top-level page of MFNs from the guest. The guest might not have
-** finished resuming from a previous restore operation, so we wait a while for
-** it to update the MFN to a reasonable value.
-*/
-static void *map_frame_list_list(xc_interface *xch, uint32_t dom,
-                                 struct save_ctx *ctx,
-                                 shared_info_any_t *shinfo)
-{
-    int count = 100;
-    void *p;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    uint64_t fll = GET_FIELD(shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width);
-
-    while ( count-- && (fll == 0) )
-    {
-        usleep(10000);
-        fll = GET_FIELD(shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width);
-    }
-
-    if ( fll == 0 )
-    {
-        ERROR("Timed out waiting for frame list updated.");
-        return NULL;
-    }
-
-    p = xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ, fll);
-    if ( p == NULL )
-        PERROR("Couldn't map p2m_frame_list_list (errno %d)", errno);
-
-    return p;
-}
-
-/*
-** During transfer (or in the state file), all page-table pages must be
-** converted into a 'canonical' form where references to actual mfns
-** are replaced with references to the corresponding pfns.
-**
-** This function performs the appropriate conversion, taking into account
-** which entries do not require canonicalization (in particular, those
-** entries which map the virtual address reserved for the hypervisor).
-*/
-static int canonicalize_pagetable(struct save_ctx *ctx,
-                           unsigned long type, unsigned long pfn,
-                           const void *spage, void *dpage)
-{
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    int i, pte_last, xen_start, xen_end, race = 0; 
-    uint64_t pte;
-
-    /*
-    ** We need to determine which entries in this page table hold
-    ** reserved hypervisor mappings. This depends on the current
-    ** page table type as well as the number of paging levels.
-    */
-    xen_start = xen_end = pte_last = PAGE_SIZE / 8;
-
-    if ( (ctx->pt_levels == 3) && (type == XEN_DOMCTL_PFINFO_L3TAB) )
-        xen_start = L3_PAGETABLE_ENTRIES_PAE;
-
-    /*
-    ** In PAE only the L2 mapping the top 1GB contains Xen mappings.
-    ** We can spot this by looking for the guest's mappingof the m2p.
-    ** Guests must ensure that this check will fail for other L2s.
-    */
-    if ( (ctx->pt_levels == 3) && (type == XEN_DOMCTL_PFINFO_L2TAB) )
-    {
-        int hstart;
-        uint64_t he;
-
-        hstart = (ctx->hvirt_start >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff;
-        he = ((const uint64_t *) spage)[hstart];
-
-        if ( ((he >> PAGE_SHIFT) & MFN_MASK_X86) == ctx->m2p_mfn0 )
-        {
-            /* hvirt starts with xen stuff... */
-            xen_start = hstart;
-        }
-        else if ( ctx->hvirt_start != 0xf5800000 )
-        {
-            /* old L2s from before hole was shrunk... */
-            hstart = (0xf5800000 >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff;
-            he = ((const uint64_t *) spage)[hstart];
-            if ( ((he >> PAGE_SHIFT) & MFN_MASK_X86) == ctx->m2p_mfn0 )
-                xen_start = hstart;
-        }
-    }
-
-    if ( (ctx->pt_levels == 4) && (type == XEN_DOMCTL_PFINFO_L4TAB) )
-    {
-        /*
-        ** XXX SMH: should compute these from hvirt_start (which we have)
-        ** and hvirt_end (which we don't)
-        */
-        xen_start = 256;
-        xen_end   = 272;
-    }
-
-    /* Now iterate through the page table, canonicalizing each PTE */
-    for (i = 0; i < pte_last; i++ )
-    {
-        unsigned long pfn, mfn;
-
-        pte = ((const uint64_t*)spage)[i];
-
-        if ( (i >= xen_start) && (i < xen_end) )
-            pte = 0;
-
-        if ( pte & _PAGE_PRESENT )
-        {
-            mfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-            if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
-            {
-                /* This will happen if the type info is stale which
-                   is quite feasible under live migration */
-                pfn  = 0;  /* zap it - we'll retransmit this page later */
-                /* XXX: We can't spot Xen mappings in compat-mode L2es 
-                 * from 64-bit tools, but the only thing in them is the
-                 * compat m2p, so we quietly zap them.  This doesn't
-                 * count as a race, so don't report it. */
-                if ( !(type == XEN_DOMCTL_PFINFO_L2TAB 
-                       && sizeof (unsigned long) > dinfo->guest_width) )
-                     race = 1;  /* inform the caller; fatal if !live */ 
-            }
-            else
-                pfn = mfn_to_pfn(mfn);
-
-            pte &= ~MADDR_MASK_X86;
-            pte |= (uint64_t)pfn << PAGE_SHIFT;
-
-            /*
-             * PAE guest L3Es can contain these flags when running on
-             * a 64bit hypervisor. We zap these here to avoid any
-             * surprise at restore time...
-             */
-            if ( (ctx->pt_levels == 3) &&
-                 (type == XEN_DOMCTL_PFINFO_L3TAB) &&
-                 (pte & (_PAGE_USER|_PAGE_RW|_PAGE_ACCESSED)) )

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:45:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAcO-00071r-DX; Fri, 31 Jul 2015 13:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcN-00071i-78
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:59 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	96/D0-05427-ADB7BB55; Fri, 31 Jul 2015 13:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1438350292!35429597!1
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 16357 invoked from network); 31 Jul 2015 13:44: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;
	31 Jul 2015 13:44:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcG-0004c5-Jx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcG-0007Pv-HS
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:44:52 +0000
Date: Fri, 31 Jul 2015 13:44:52 +0000
Message-Id: <E1ZLAcG-0007Pv-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove legacy migration
	implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b15bc4345e772df92e5ffdbc4c1e9ae2a6206617
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:27 2015 +0100

    tools/libxc: Remove legacy migration implementation
    
    It is no longer used.
    
    One complication is that xc_map_m2p() has users in xc_offline_page.c,
    xen-mfndump and xen-mceinj.  Move its implementation into
    xc_offline_page (for want of a better location) beside it's current
    user.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- drop mentions of removed files from MAINTAINERS ]
---
 MAINTAINERS                     |    2 -
 tools/libxc/Makefile            |    1 -
 tools/libxc/xc_domain_restore.c | 2411 ---------------------------------------
 tools/libxc/xc_domain_save.c    | 2198 -----------------------------------
 tools/libxc/xc_offline_page.c   |   59 +
 tools/libxc/xg_save_restore.h   |  247 ----
 6 files changed, 59 insertions(+), 4859 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index a4e64ea..73a96c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -272,8 +272,6 @@ M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 M:	Yang Hongyang <yanghy@cn.fujitsu.com>
 S:	Maintained
 F:	docs/README.remus
-F:	tools/libxc/xc_domain_save.c
-F:	tools/libxc/xc_domain_restore.c
 F:	tools/blktap2/drivers/block-remus.c
 F:	tools/blktap2/drivers/hashtable*
 F:	tools/libxl/libxl_remus_*
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index b0a3e05..8ae0ea0 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -54,7 +54,6 @@ CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c xc_suspend.c
 ifeq ($(CONFIG_MIGRATE),y)
-GUEST_SRCS-y += xc_domain_restore.c xc_domain_save.c
 GUEST_SRCS-y += xc_sr_common.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
deleted file mode 100644
index 8435f6b..0000000
--- a/tools/libxc/xc_domain_restore.c
+++ /dev/null
@@ -1,2411 +0,0 @@
-/******************************************************************************
- * xc_domain_restore.c
- *
- * Restore the state of a guest session.
- *
- * Copyright (c) 2003, K A Fraser.
- * Copyright (c) 2006, Intel Corporation
- * Copyright (c) 2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-/*
- * The superpages flag in restore has two different meanings depending on
- * the type of domain.
- *
- * For an HVM domain, the flag means to look for properly aligned contiguous
- * pages and try to allocate a superpage to satisfy it.  If that fails,
- * fall back to small pages.
- *
- * For a PV domain, the flag means allocate all memory as superpages.  If that
- * fails, the restore fails.  This behavior is required for PV guests who
- * want to use superpages.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_save_restore.h"
-#include "xc_dom.h"
-
-#include <xen/hvm/ioreq.h>
-#include <xen/hvm/params.h>
-
-struct restore_ctx {
-    unsigned long max_mfn; /* max mfn of the current host machine */
-    unsigned long hvirt_start; /* virtual starting address of the hypervisor */
-    unsigned int pt_levels; /* #levels of page tables used by the current guest */
-    unsigned long nr_pfns; /* number of 'in use' pfns in the guest (i.e. #P2M entries with a valid mfn) */
-    xen_pfn_t *live_p2m; /* Live mapping of the table mapping each PFN to its current MFN. */
-    xen_pfn_t *p2m; /* A table mapping each PFN to its new MFN. */
-    xen_pfn_t *p2m_batch; /* A table of P2M mappings in the current region.  */
-    xen_pfn_t *p2m_saved_batch; /* Copy of p2m_batch array for pv superpage alloc */
-    int superpages; /* Superpage allocation has been requested */
-    int hvm;    /* This is an hvm domain */
-    int completed; /* Set when a consistent image is available */
-    int last_checkpoint; /* Set when we should commit to the current checkpoint when it completes. */
-    int compressing; /* Set when sender signals that pages would be sent compressed (for Remus) */
-    struct domain_info_context dinfo;
-};
-
-#define HEARTBEAT_MS 1000
-
-#ifndef __MINIOS__
-static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx,
-                       int fd, void* buf, size_t size)
-{
-    size_t offset = 0;
-    ssize_t len;
-    struct timeval tv;
-    fd_set rfds;
-
-    while ( offset < size )
-    {
-        if ( ctx->completed ) {
-            /* expect a heartbeat every HEARBEAT_MS ms maximum */
-            tv.tv_sec = HEARTBEAT_MS / 1000;
-            tv.tv_usec = (HEARTBEAT_MS % 1000) * 1000;
-
-            FD_ZERO(&rfds);
-            FD_SET(fd, &rfds);
-            len = select(fd + 1, &rfds, NULL, NULL, &tv);
-            if ( len == -1 && errno == EINTR )
-                continue;
-            if ( !FD_ISSET(fd, &rfds) ) {
-                ERROR("%s failed (select returned %zd)", __func__, len);
-                errno = ETIMEDOUT;
-                return -1;
-            }
-        }
-
-        len = read(fd, buf + offset, size - offset);
-        if ( (len == -1) && ((errno == EINTR) || (errno == EAGAIN)) )
-            continue;
-        if ( len == 0 ) {
-            ERROR("0-length read");
-            errno = 0;
-        }
-        if ( len <= 0 ) {
-            ERROR("%s failed (read rc: %zd, errno: %d)", __func__, len, errno);
-            return -1;
-        }
-        offset += len;
-    }
-
-    return 0;
-}
-
-#define RDEXACT(fd,buf,size) rdexact(xch, ctx, fd, buf, size)
-#else
-#define RDEXACT read_exact
-#endif
-
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
-#define SUPERPAGE(_pfn) ((_pfn) & (~(SUPERPAGE_NR_PFNS-1)))
-#define SUPER_PAGE_START(pfn)    (((pfn) & (SUPERPAGE_NR_PFNS-1)) == 0 )
-
-/*
-** When we're restoring into a pv superpage-allocated guest, we take
-** a copy of the p2m_batch array to preserve the pfn, then allocate the
-** corresponding superpages.  We then fill in the p2m array using the saved
-** pfns.
-*/
-static int alloc_superpage_mfns(
-    xc_interface *xch, uint32_t dom, struct restore_ctx *ctx, int nr_mfns)
-{
-    int i, j, max = 0;
-    unsigned long pfn, base_pfn, mfn;
-
-    for (i = 0; i < nr_mfns; i++)
-    {
-        pfn = ctx->p2m_batch[i];
-        base_pfn = SUPERPAGE(pfn);
-        if (ctx->p2m[base_pfn] != (INVALID_P2M_ENTRY-2))
-        {
-            ctx->p2m_saved_batch[max] = base_pfn;
-            ctx->p2m_batch[max] = base_pfn;
-            max++;
-            ctx->p2m[base_pfn] = INVALID_P2M_ENTRY-2;
-        }
-    }
-    if (xc_domain_populate_physmap_exact(xch, dom, max, SUPERPAGE_PFN_SHIFT,
-                                         0, ctx->p2m_batch) != 0)
-        return 1;
-
-    for (i = 0; i < max; i++)
-    {
-        mfn = ctx->p2m_batch[i];
-        pfn = ctx->p2m_saved_batch[i];
-        for (j = 0; j < SUPERPAGE_NR_PFNS; j++)
-            ctx->p2m[pfn++] = mfn++;
-    }
-    return 0;
-}
-/*
-** In the state file (or during transfer), all page-table pages are
-** converted into a 'canonical' form where references to actual mfns
-** are replaced with references to the corresponding pfns.
-** This function inverts that operation, replacing the pfn values with
-** the (now known) appropriate mfn values.
-*/
-static int uncanonicalize_pagetable(
-    xc_interface *xch, uint32_t dom, struct restore_ctx *ctx, void *page)
-{
-    int i, rc, pte_last, nr_mfns = 0;
-    unsigned long pfn;
-    uint64_t pte;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    pte_last = PAGE_SIZE / 8;
-
-    /* First pass: work out how many (if any) MFNs we need to alloc */
-    for ( i = 0; i < pte_last; i++ )
-    {
-        pte = ((uint64_t *)page)[i];
-
-        /* XXX SMH: below needs fixing for PROT_NONE etc */
-        if ( !(pte & _PAGE_PRESENT) )
-            continue;
-        
-        pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-        
-        if ( pfn >= dinfo->p2m_size )
-        {
-            /* This "page table page" is probably not one; bail. */
-            ERROR("Frame number in page table is out of range: "
-                  "i=%d pfn=0x%lx p2m_size=%lu",
-                  i, pfn, dinfo->p2m_size);
-            return 0;
-        }
-        
-        if ( ctx->p2m[pfn] == INVALID_P2M_ENTRY )
-        {
-            /* Have a 'valid' PFN without a matching MFN - need to alloc */
-            ctx->p2m_batch[nr_mfns++] = pfn; 
-            ctx->p2m[pfn]--;
-        }
-    }
-
-    /* Allocate the requisite number of mfns. */
-    if (nr_mfns)
-    {
-        if (!ctx->hvm && ctx->superpages)
-            rc = alloc_superpage_mfns(xch, dom, ctx, nr_mfns);
-        else
-            rc = xc_domain_populate_physmap_exact(xch, dom, nr_mfns, 0, 0,
-                                                  ctx->p2m_batch);
-
-        if (rc)
-        {
-            ERROR("Failed to allocate memory for batch.!\n");
-            errno = ENOMEM;
-            return 0;
-        }
-    }
-    
-    /* Second pass: uncanonicalize each present PTE */
-    nr_mfns = 0;
-    for ( i = 0; i < pte_last; i++ )
-    {
-        pte = ((uint64_t *)page)[i];
-        
-        /* XXX SMH: below needs fixing for PROT_NONE etc */
-        if ( !(pte & _PAGE_PRESENT) )
-            continue;
-        
-        pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-
-        if ( ctx->p2m[pfn] == (INVALID_P2M_ENTRY-1) )
-            ctx->p2m[pfn] = ctx->p2m_batch[nr_mfns++];
-
-        pte &= ~MADDR_MASK_X86;
-        pte |= (uint64_t)ctx->p2m[pfn] << PAGE_SHIFT;
-
-        ((uint64_t *)page)[i] = (uint64_t)pte;
-    }
-
-    return 1;
-}
-
-
-/* Load the p2m frame list, plus potential extended info chunk */
-static xen_pfn_t *load_p2m_frame_list(
-    xc_interface *xch, struct restore_ctx *ctx,
-    int io_fd, int *pae_extended_cr3, int *ext_vcpucontext,
-    uint32_t *vcpuextstate_size)
-{
-    xen_pfn_t *p2m_frame_list;
-    vcpu_guest_context_any_t ctxt;
-    xen_pfn_t p2m_fl_zero;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    /* Read first entry of P2M list, or extended-info signature (~0UL). */
-    if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(long)) )
-    {
-        PERROR("read extended-info signature failed");
-        return NULL;
-    }
-    
-    if ( p2m_fl_zero == ~0UL )
-    {
-        uint32_t tot_bytes;
-        
-        /* Next 4 bytes: total size of following extended info. */
-        if ( RDEXACT(io_fd, &tot_bytes, sizeof(tot_bytes)) )
-        {
-            PERROR("read extended-info size failed");
-            return NULL;
-        }
-        
-        while ( tot_bytes )
-        {
-            uint32_t chunk_bytes;
-            char     chunk_sig[4];
-            
-            /* 4-character chunk signature + 4-byte remaining chunk size. */
-            if ( RDEXACT(io_fd, chunk_sig, sizeof(chunk_sig)) ||
-                 RDEXACT(io_fd, &chunk_bytes, sizeof(chunk_bytes)) ||
-                 (tot_bytes < (chunk_bytes + 8)) )
-            {
-                PERROR("read extended-info chunk signature failed");
-                return NULL;
-            }
-            tot_bytes -= 8;
-
-            /* VCPU context structure? */
-            if ( !strncmp(chunk_sig, "vcpu", 4) )
-            {
-                /* Pick a guest word-size and PT depth from the ctxt size */
-                if ( chunk_bytes == sizeof (ctxt.x32) )
-                {
-                    dinfo->guest_width = 4;
-                    ctx->pt_levels = 3;
-                }
-                else if ( chunk_bytes == sizeof (ctxt.x64) )
-                {
-                    dinfo->guest_width = 8;
-                    ctx->pt_levels = 4;
-                }
-                else 
-                {
-                    ERROR("bad extended-info context size %d", chunk_bytes);
-                    return NULL;
-                }
-
-                if ( RDEXACT(io_fd, &ctxt, chunk_bytes) )
-                {
-                    PERROR("read extended-info vcpu context failed");
-                    return NULL;
-                }
-                tot_bytes -= chunk_bytes;
-                chunk_bytes = 0;
-
-                if ( GET_FIELD(&ctxt, vm_assist, dinfo->guest_width)
-                     & (1UL << VMASST_TYPE_pae_extended_cr3) )
-                    *pae_extended_cr3 = 1;
-            }
-            else if ( !strncmp(chunk_sig, "extv", 4) )
-            {
-                *ext_vcpucontext = 1;
-            }
-            else if ( !strncmp(chunk_sig, "xcnt", 4) )
-            {
-                if ( RDEXACT(io_fd, vcpuextstate_size, sizeof(*vcpuextstate_size)) )
-                {
-                    PERROR("read extended vcpu state size failed");
-                    return NULL;
-                }
-                tot_bytes -= chunk_bytes;
-                chunk_bytes = 0;
-            }
-            
-            /* Any remaining bytes of this chunk: read and discard. */
-            while ( chunk_bytes )
-            {
-                unsigned long sz = min_t(unsigned long, chunk_bytes, sizeof(xen_pfn_t));
-                if ( RDEXACT(io_fd, &p2m_fl_zero, sz) )
-                {
-                    PERROR("read-and-discard extended-info chunk bytes failed");
-                    return NULL;
-                }
-                chunk_bytes -= sz;
-                tot_bytes   -= sz;
-            }
-        }
-
-        /* Now read the real first entry of P2M list. */
-        if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(xen_pfn_t)) )
-        {
-            PERROR("read first entry of p2m_frame_list failed");
-            return NULL;
-        }
-    }
-
-    /* Now that we know the guest's word-size, can safely allocate 
-     * the p2m frame list */
-    if ( (p2m_frame_list = malloc(P2M_TOOLS_FL_SIZE)) == NULL )
-    {
-        ERROR("Couldn't allocate p2m_frame_list array");
-        return NULL;
-    }
-
-    /* First entry has already been read. */
-    p2m_frame_list[0] = p2m_fl_zero;
-    if ( RDEXACT(io_fd, &p2m_frame_list[1], 
-                 (P2M_FL_ENTRIES - 1) * sizeof(xen_pfn_t)) )
-    {
-        PERROR("read p2m_frame_list failed");
-        free(p2m_frame_list);
-        return NULL;
-    }
-    
-    return p2m_frame_list;
-}
-
-typedef struct {
-    int ishvm;
-    union {
-        struct tailbuf_pv {
-            unsigned int pfncount;
-            unsigned long* pfntab;
-            unsigned int vcpucount;
-            unsigned char* vcpubuf;
-            unsigned char shared_info_page[PAGE_SIZE];
-        } pv;
-        struct tailbuf_hvm {
-            uint64_t magicpfns[3];
-            uint32_t hvmbufsize, reclen;
-            uint8_t* hvmbuf;
-            struct {
-                uint32_t magic;
-                uint32_t version;
-                uint64_t len;
-            } qemuhdr;
-            uint32_t qemubufsize;
-            uint8_t* qemubuf;
-        } hvm;
-    } u;
-} tailbuf_t;
-
-/* read stream until EOF, growing buffer as necssary */
-static int compat_buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
-                              int fd, struct tailbuf_hvm *buf)
-{
-    uint8_t *qbuf, *tmp;
-    int blen = 0, dlen = 0;
-    int rc;
-
-    /* currently save records tend to be about 7K */
-    blen = 8192;
-    if ( !(qbuf = malloc(blen)) ) {
-        ERROR("Error allocating QEMU buffer");
-        return -1;
-    }
-
-    while( (rc = read(fd, qbuf+dlen, blen-dlen)) > 0 ) {
-        DPRINTF("Read %d bytes of QEMU data\n", rc);
-        dlen += rc;
-
-        if (dlen == blen) {
-            DPRINTF("%d-byte QEMU buffer full, reallocating...\n", dlen);
-            blen += 4096;
-            tmp = realloc(qbuf, blen);
-            if ( !tmp ) {
-                ERROR("Error growing QEMU buffer to %d bytes", blen);
-                free(qbuf);
-                return -1;
-            }
-            qbuf = tmp;
-        }
-    }
-
-    if ( rc < 0 ) {
-        ERROR("Error reading QEMU data");
-        free(qbuf);
-        return -1;
-    }
-
-    if ( memcmp(qbuf, "QEVM", 4) ) {
-        ERROR("Invalid QEMU magic: 0x%08"PRIx32, *(uint32_t*)qbuf);
-        free(qbuf);
-        return -1;
-    }
-
-    buf->qemubuf = qbuf;
-    buf->qemubufsize = dlen;
-
-    return 0;
-}
-
-static int buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
-                       int fd, struct tailbuf_hvm *buf)
-{
-    uint32_t qlen;
-    uint8_t *tmp;
-
-    if ( RDEXACT(fd, &qlen, sizeof(qlen)) ) {
-        PERROR("Error reading QEMU header length");
-        return -1;
-    }
-
-    if ( qlen > buf->qemubufsize ) {
-        if ( buf->qemubuf) {
-            tmp = realloc(buf->qemubuf, qlen);
-            if ( tmp )
-                buf->qemubuf = tmp;
-            else {
-                ERROR("Error reallocating QEMU state buffer");
-                return -1;
-            }
-        } else {
-            buf->qemubuf = malloc(qlen);
-            if ( !buf->qemubuf ) {
-                ERROR("Error allocating QEMU state buffer");
-                return -1;
-            }
-        }
-    }
-    buf->qemubufsize = qlen;
-
-    if ( RDEXACT(fd, buf->qemubuf, buf->qemubufsize) ) {
-        PERROR("Error reading QEMU state");
-        return -1;
-    }
-
-    return 0;
-}
-
-static int dump_qemu(xc_interface *xch, uint32_t dom, struct tailbuf_hvm *buf)
-{
-    int saved_errno;
-    char path[256];
-    FILE *fp;
-
-    sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dom);
-    fp = fopen(path, "wb");
-    if ( !fp )
-        return -1;
-
-    DPRINTF("Writing %d bytes of QEMU data\n", buf->qemubufsize);
-    if ( fwrite(buf->qemubuf, 1, buf->qemubufsize, fp) != buf->qemubufsize) {
-        saved_errno = errno;
-        fclose(fp);
-        errno = saved_errno;
-        return -1;
-    }
-
-    fclose(fp);
-
-    return 0;
-}
-
-static int buffer_tail_hvm(xc_interface *xch, struct restore_ctx *ctx,
-                           struct tailbuf_hvm *buf, int fd,
-                           unsigned int max_vcpu_id, uint64_t *vcpumap,
-                           int ext_vcpucontext,
-                           uint32_t vcpuextstate_size)
-{
-    uint8_t *tmp;
-    unsigned char qemusig[21];
-
-    if ( RDEXACT(fd, buf->magicpfns, sizeof(buf->magicpfns)) ) {
-        PERROR("Error reading magic PFNs");
-        return -1;
-    }
-
-    if ( RDEXACT(fd, &buf->reclen, sizeof(buf->reclen)) ) {
-        PERROR("Error reading HVM params size");
-        return -1;
-    }
-
-    if ( buf->reclen > buf->hvmbufsize ) {
-        if ( buf->hvmbuf) {
-            tmp = realloc(buf->hvmbuf, buf->reclen);
-            if ( tmp ) {
-                buf->hvmbuf = tmp;
-                buf->hvmbufsize = buf->reclen;
-            } else {
-                ERROR("Error reallocating HVM param buffer");
-                return -1;
-            }
-        } else {
-            buf->hvmbuf = malloc(buf->reclen);
-            if ( !buf->hvmbuf ) {
-                ERROR("Error allocating HVM param buffer");
-                return -1;
-            }
-            buf->hvmbufsize = buf->reclen;
-        }
-    }
-
-    if ( RDEXACT(fd, buf->hvmbuf, buf->reclen) ) {
-        PERROR("Error reading HVM params");
-        return -1;
-    }
-
-    if ( RDEXACT(fd, qemusig, sizeof(qemusig)) ) {
-        PERROR("Error reading QEMU signature");
-        return -1;
-    }
-
-    /* The legacy live-migration QEMU record has no length information.
-     * Short of reimplementing the QEMU parser, we're forced to just read
-     * until EOF.
-     *
-     * Gets around this by sending a different signatures for the new
-     * live-migration QEMU record and Remus which includes a length
-     * prefix
-     */
-    if ( !memcmp(qemusig, "QemuDeviceModelRecord", sizeof(qemusig)) )
-        return compat_buffer_qemu(xch, ctx, fd, buf);
-    else if ( !memcmp(qemusig, "DeviceModelRecord0002", sizeof(qemusig)) ||
-              !memcmp(qemusig, "RemusDeviceModelState", sizeof(qemusig)) )
-        return buffer_qemu(xch, ctx, fd, buf);
-
-    qemusig[20] = '\0';
-    ERROR("Invalid QEMU signature: %s", qemusig);
-    return -1;
-}
-
-static int buffer_tail_pv(xc_interface *xch, struct restore_ctx *ctx,
-                          struct tailbuf_pv *buf, int fd,
-                          unsigned int max_vcpu_id, uint64_t *vcpumap,
-                          int ext_vcpucontext,
-                          uint32_t vcpuextstate_size)
-{
-    unsigned int i;
-    size_t pfnlen, vcpulen;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    /* TODO: handle changing pfntab and vcpu counts */
-    /* PFN tab */
-    if ( RDEXACT(fd, &buf->pfncount, sizeof(buf->pfncount)) ||
-         (buf->pfncount > (1U << 28)) ) /* up to 1TB of address space */
-    {
-        PERROR("Error when reading pfn count");
-        return -1;
-    }
-    pfnlen = sizeof(unsigned long) * buf->pfncount;
-    if ( !(buf->pfntab) ) {
-        if ( !(buf->pfntab = malloc(pfnlen)) ) {
-            ERROR("Error allocating PFN tail buffer");
-            return -1;
-        }
-    }
-    // DPRINTF("Reading PFN tab: %d bytes\n", pfnlen);
-    if ( RDEXACT(fd, buf->pfntab, pfnlen) ) {
-        PERROR("Error when reading pfntab");
-        goto free_pfntab;
-    }
-
-    /* VCPU contexts */
-    buf->vcpucount = 0;
-    for (i = 0; i <= max_vcpu_id; i++) {
-        // DPRINTF("vcpumap: %llx, cpu: %d, bit: %llu\n", vcpumap[i/64], i, (vcpumap[i/64] & (1ULL << (i%64))));
-        if ( (!(vcpumap[i/64] & (1ULL << (i%64)))) )
-            continue;
-        buf->vcpucount++;
-    }
-    // DPRINTF("VCPU count: %d\n", buf->vcpucount);
-    vcpulen = ((dinfo->guest_width == 8) ? sizeof(vcpu_guest_context_x86_64_t)
-               : sizeof(vcpu_guest_context_x86_32_t)) * buf->vcpucount;
-    if ( ext_vcpucontext )
-        vcpulen += 128 * buf->vcpucount;
-    vcpulen += vcpuextstate_size * buf->vcpucount;
-
-    if ( !(buf->vcpubuf) ) {
-        if ( !(buf->vcpubuf = malloc(vcpulen)) ) {
-            ERROR("Error allocating VCPU ctxt tail buffer");
-            goto free_pfntab;
-        }
-    }
-    // DPRINTF("Reading VCPUS: %d bytes\n", vcpulen);
-    if ( RDEXACT(fd, buf->vcpubuf, vcpulen) ) {
-        PERROR("Error when reading ctxt");
-        goto free_vcpus;
-    }
-
-    /* load shared_info_page */
-    // DPRINTF("Reading shared info: %lu bytes\n", PAGE_SIZE);
-    if ( RDEXACT(fd, buf->shared_info_page, PAGE_SIZE) ) {
-        PERROR("Error when reading shared info page");
-        goto free_vcpus;
-    }
-
-    return 0;
-
-  free_vcpus:
-    if (buf->vcpubuf) {
-        free (buf->vcpubuf);
-        buf->vcpubuf = NULL;
-    }
-  free_pfntab:
-    if (buf->pfntab) {
-        free (buf->pfntab);
-        buf->pfntab = NULL;
-    }
-
-    return -1;
-}
-
-static int buffer_tail(xc_interface *xch, struct restore_ctx *ctx,
-                       tailbuf_t *buf, int fd, unsigned int max_vcpu_id,
-                       uint64_t *vcpumap, int ext_vcpucontext,
-                       uint32_t vcpuextstate_size)
-{
-    if ( buf->ishvm )
-        return buffer_tail_hvm(xch, ctx, &buf->u.hvm, fd, max_vcpu_id, vcpumap,
-                               ext_vcpucontext, vcpuextstate_size);
-    else
-        return buffer_tail_pv(xch, ctx, &buf->u.pv, fd, max_vcpu_id, vcpumap,
-                              ext_vcpucontext, vcpuextstate_size);
-}
-
-static void tailbuf_free_hvm(struct tailbuf_hvm *buf)
-{
-    if ( buf->hvmbuf ) {
-        free(buf->hvmbuf);
-        buf->hvmbuf = NULL;
-    }
-    if ( buf->qemubuf ) {
-        free(buf->qemubuf);
-        buf->qemubuf = NULL;
-    }
-}
-
-static void tailbuf_free_pv(struct tailbuf_pv *buf)
-{
-    if ( buf->vcpubuf ) {
-        free(buf->vcpubuf);
-        buf->vcpubuf = NULL;
-    }
-    if ( buf->pfntab ) {
-        free(buf->pfntab);
-        buf->pfntab = NULL;
-    }
-}
-
-static void tailbuf_free(tailbuf_t *buf)
-{
-    if ( buf->ishvm )
-        tailbuf_free_hvm(&buf->u.hvm);
-    else
-        tailbuf_free_pv(&buf->u.pv);
-}
-
-struct toolstack_data_t {
-    uint8_t *data;
-    uint32_t len;
-};
-
-typedef struct {
-    void* pages;
-    /* pages is of length nr_physpages, pfn_types is of length nr_pages */
-    unsigned int nr_physpages, nr_pages;
-
-    /* checkpoint compression state */
-    int compressing;
-    unsigned long compbuf_pos, compbuf_size;
-
-    /* Types of the pfns in the current region */
-    unsigned long* pfn_types;
-
-    int verify;
-
-    int new_ctxt_format;
-    int max_vcpu_id;
-    uint64_t vcpumap[XC_SR_MAX_VCPUS/64];
-    uint64_t identpt;
-    uint64_t paging_ring_pfn;
-    uint64_t monitor_ring_pfn;
-    uint64_t sharing_ring_pfn;
-    uint64_t vm86_tss;
-    uint64_t console_pfn;
-    uint64_t acpi_ioport_location;
-    uint64_t viridian;
-    uint64_t vm_generationid_addr;
-    uint64_t ioreq_server_pfn;
-    uint64_t nr_ioreq_server_pages;
-
-    struct toolstack_data_t tdata;
-} pagebuf_t;
-
-static int pagebuf_init(pagebuf_t* buf)
-{
-    memset(buf, 0, sizeof(*buf));
-    return 0;
-}
-
-static void pagebuf_free(pagebuf_t* buf)
-{
-    if (buf->tdata.data != NULL) {
-        free(buf->tdata.data);
-        buf->tdata.data = NULL;
-    }
-    if (buf->pages) {
-        free(buf->pages);
-        buf->pages = NULL;
-    }
-    if(buf->pfn_types) {
-        free(buf->pfn_types);
-        buf->pfn_types = NULL;
-    }
-}
-
-static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx,
-                           pagebuf_t* buf, int fd, uint32_t dom)
-{
-    int count, countpages, oldcount, i;
-    void* ptmp;
-    unsigned long compbuf_size;
-
-    if ( RDEXACT(fd, &count, sizeof(count)) )
-    {
-        PERROR("Error when reading batch size");
-        return -1;
-    }
-
-    // DPRINTF("reading batch of %d pages\n", count);
-
-    switch ( count )
-    {
-    case 0:
-        // DPRINTF("Last batch read\n");
-        return 0;
-
-    case XC_SAVE_ID_ENABLE_VERIFY_MODE:
-        DPRINTF("Entering page verify mode\n");
-        buf->verify = 1;
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_VCPU_INFO:
-        buf->new_ctxt_format = 1;
-        if ( RDEXACT(fd, &buf->max_vcpu_id, sizeof(buf->max_vcpu_id)) ||
-             buf->max_vcpu_id >= XC_SR_MAX_VCPUS ||
-             RDEXACT(fd, buf->vcpumap, vcpumap_sz(buf->max_vcpu_id)) ) {
-            PERROR("Error when reading max_vcpu_id");
-            return -1;
-        }
-        // DPRINTF("Max VCPU ID: %d, vcpumap: %llx\n", buf->max_vcpu_id, buf->vcpumap[0]);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_IDENT_PT:
-        /* Skip padding 4 bytes then read the EPT identity PT location. */
-        if ( RDEXACT(fd, &buf->identpt, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->identpt, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the EPT identity map");
-            return -1;
-        }
-        // DPRINTF("EPT identity map address: %llx\n", buf->identpt);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_PAGING_RING_PFN:
-        /* Skip padding 4 bytes then read the paging ring location. */
-        if ( RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the paging ring pfn");
-            return -1;
-        }
-        // DPRINTF("paging ring pfn address: %llx\n", buf->paging_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_MONITOR_RING_PFN:
-        /* Skip padding 4 bytes then read the mem access ring location. */
-        if ( RDEXACT(fd, &buf->monitor_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->monitor_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the access ring pfn");
-            return -1;
-        }
-        // DPRINTF("monitor ring pfn address: %llx\n", buf->monitor_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_SHARING_RING_PFN:
-        /* Skip padding 4 bytes then read the sharing ring location. */
-        if ( RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the sharing ring pfn");
-            return -1;
-        }
-        // DPRINTF("sharing ring pfn address: %llx\n", buf->sharing_ring_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_VM86_TSS:
-        /* Skip padding 4 bytes then read the vm86 TSS location. */
-        if ( RDEXACT(fd, &buf->vm86_tss, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->vm86_tss, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the vm86 TSS");
-            return -1;
-        }
-        // DPRINTF("VM86 TSS location: %llx\n", buf->vm86_tss);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TMEM:
-        DPRINTF("xc_domain_restore start tmem\n");
-        if ( xc_tmem_restore(xch, dom, fd) ) {
-            PERROR("error reading/restoring tmem");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TMEM_EXTRA:
-        if ( xc_tmem_restore_extra(xch, dom, fd) ) {
-            PERROR("error reading/restoring tmem extra");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TSC_INFO:
-    {
-        uint32_t tsc_mode, khz, incarn;
-        uint64_t nsec;
-        if ( RDEXACT(fd, &tsc_mode, sizeof(uint32_t)) ||
-             RDEXACT(fd, &nsec, sizeof(uint64_t)) ||
-             RDEXACT(fd, &khz, sizeof(uint32_t)) ||
-             RDEXACT(fd, &incarn, sizeof(uint32_t)) ||
-             xc_domain_set_tsc_info(xch, dom, tsc_mode, nsec, khz, incarn) ) {
-            PERROR("error reading/restoring tsc info");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-    }
-
-    case XC_SAVE_ID_HVM_CONSOLE_PFN :
-        /* Skip padding 4 bytes then read the console pfn location. */
-        if ( RDEXACT(fd, &buf->console_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->console_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the address of the console pfn");
-            return -1;
-        }
-        // DPRINTF("console pfn location: %llx\n", buf->console_pfn);
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_LAST_CHECKPOINT:
-        ctx->last_checkpoint = 1;
-        // DPRINTF("last checkpoint indication received");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION:
-        /* Skip padding 4 bytes then read the acpi ioport location. */
-        if ( RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint64_t)) )
-        {
-            PERROR("error read the acpi ioport location");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_VIRIDIAN:
-        /* Skip padding 4 bytes then read the acpi ioport location. */
-        if ( RDEXACT(fd, &buf->viridian, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->viridian, sizeof(uint64_t)) )
-        {
-            PERROR("error reading the viridian enlightenments");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_TOOLSTACK:
-        {
-            if ( RDEXACT(fd, &buf->tdata.len, sizeof(buf->tdata.len)) )
-            {
-                PERROR("error read toolstack id size");
-                return -1;
-            }
-            buf->tdata.data = (uint8_t*) realloc(buf->tdata.data, buf->tdata.len);
-            if ( buf->tdata.data == NULL )
-            {
-                PERROR("error memory allocation");
-                return -1;
-            }
-            if ( RDEXACT(fd, buf->tdata.data, buf->tdata.len) )
-            {
-                PERROR("error read toolstack id");
-                return -1;
-            }
-            return pagebuf_get_one(xch, ctx, buf, fd, dom);
-        }
-
-    case XC_SAVE_ID_ENABLE_COMPRESSION:
-        /* We cannot set compression flag directly in pagebuf structure,
-         * since this pagebuf still has uncompressed pages that are yet to
-         * be applied. We enable the compression field in pagebuf structure
-         * after receiving the first tailbuf.
-         */
-        ctx->compressing = 1;
-        // DPRINTF("compression flag received");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_COMPRESSED_DATA:
-
-        /* read the length of compressed chunk coming in */
-        if ( RDEXACT(fd, &compbuf_size, sizeof(unsigned long)) )
-        {
-            PERROR("Error when reading compbuf_size");
-            return -1;
-        }
-        if (!compbuf_size) return 1;
-
-        buf->compbuf_size += compbuf_size;
-        if (!(ptmp = realloc(buf->pages, buf->compbuf_size))) {
-            ERROR("Could not (re)allocate compression buffer");
-            return -1;
-        }
-        buf->pages = ptmp;
-
-        if ( RDEXACT(fd, buf->pages + (buf->compbuf_size - compbuf_size),
-                     compbuf_size) ) {
-            PERROR("Error when reading compression buffer");
-            return -1;
-        }
-        return compbuf_size;
-
-    case XC_SAVE_ID_HVM_GENERATION_ID_ADDR:
-        /* Skip padding 4 bytes then read the generation id buffer location. */
-        if ( RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint64_t)) )
-        {
-            PERROR("error read the generation id buffer location");
-            return -1;
-        }
-        DPRINTF("read generation id buffer address");
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_IOREQ_SERVER_PFN:
-        /* Skip padding 4 bytes then read the ioreq server gmfn base. */
-        if ( RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint64_t)) )
-        {
-            PERROR("error read the ioreq server gmfn base");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    case XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES:
-        /* Skip padding 4 bytes then read the ioreq server gmfn count. */
-        if ( RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint32_t)) ||
-             RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint64_t)) )
-        {
-            PERROR("error read the ioreq server gmfn count");
-            return -1;
-        }
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    default:
-        if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
-            ERROR("Max batch size exceeded (%d). Giving up.", count);
-            errno = EMSGSIZE;
-            return -1;
-        }
-        break;
-    }
-
-    oldcount = buf->nr_pages;
-    buf->nr_pages += count;
-    if (!buf->pfn_types) {
-        if (!(buf->pfn_types = malloc(buf->nr_pages * sizeof(*(buf->pfn_types))))) {
-            ERROR("Could not allocate PFN type buffer");
-            return -1;
-        }
-    } else {
-        if (!(ptmp = realloc(buf->pfn_types, buf->nr_pages * sizeof(*(buf->pfn_types))))) {
-            ERROR("Could not reallocate PFN type buffer");
-            return -1;
-        }
-        buf->pfn_types = ptmp;
-    }
-    if ( RDEXACT(fd, buf->pfn_types + oldcount, count * sizeof(*(buf->pfn_types)))) {
-        PERROR("Error when reading region pfn types");
-        return -1;
-    }
-
-    countpages = count;
-    for (i = oldcount; i < buf->nr_pages; ++i)
-    {
-        unsigned long pagetype;
-
-        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
-             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
-             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
-            --countpages;
-    }
-
-    if (!countpages)
-        return count;
-
-    /* If Remus Checkpoint Compression is turned on, we will only be
-     * receiving the pfn lists now. The compressed pages will come in later,
-     * following a <XC_SAVE_ID_COMPRESSED_DATA, compressedChunkSize> tuple.
-     */
-    if (buf->compressing)
-        return pagebuf_get_one(xch, ctx, buf, fd, dom);
-
-    oldcount = buf->nr_physpages;
-    buf->nr_physpages += countpages;
-    if (!buf->pages) {
-        if (!(buf->pages = malloc(buf->nr_physpages * PAGE_SIZE))) {
-            ERROR("Could not allocate page buffer");
-            return -1;
-        }
-    } else {
-        if (!(ptmp = realloc(buf->pages, buf->nr_physpages * PAGE_SIZE))) {
-            ERROR("Could not reallocate page buffer");
-            return -1;
-        }
-        buf->pages = ptmp;
-    }
-    if ( RDEXACT(fd, buf->pages + oldcount * PAGE_SIZE, countpages * PAGE_SIZE) ) {
-        PERROR("Error when reading pages");
-        return -1;
-    }
-
-    return count;
-}
-
-static int pagebuf_get(xc_interface *xch, struct restore_ctx *ctx,
-                       pagebuf_t* buf, int fd, uint32_t dom)
-{
-    int rc;
-
-    buf->nr_physpages = buf->nr_pages = 0;
-    buf->compbuf_pos = buf->compbuf_size = 0;
-
-    do {
-        rc = pagebuf_get_one(xch, ctx, buf, fd, dom);
-    } while (rc > 0);
-
-    if (rc < 0)
-        pagebuf_free(buf);
-
-    return rc;
-}
-
-static int apply_batch(xc_interface *xch, uint32_t dom, struct restore_ctx *ctx,
-                       xen_pfn_t* region_mfn, unsigned long* pfn_type, int pae_extended_cr3,
-                       struct xc_mmu* mmu,
-                       pagebuf_t* pagebuf, int curbatch, int *invalid_pages)
-{
-    int i, j, curpage, nr_mfns;
-    int k, scount;
-    unsigned long superpage_start=INVALID_P2M_ENTRY;
-    /* used by debug verify code */
-    unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
-    /* Our mapping of the current region (batch) */
-    char *region_base;
-    /* A temporary mapping, and a copy, of one frame of guest memory. */
-    unsigned long *page = NULL;
-    int nraces = 0;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    int* pfn_err = NULL;
-    int rc = -1;
-    int local_invalid_pages = 0;
-    /* We have handled curbatch pages before this batch, and there are
-     * *invalid_pages pages that are not in pagebuf->pages. So the first
-     * page for this page is (curbatch - *invalid_pages) page.
-     */
-    int first_page = curbatch - *invalid_pages;
-
-    unsigned long mfn, pfn, pagetype;
-
-    j = pagebuf->nr_pages - curbatch;
-    if (j > MAX_BATCH_SIZE)
-        j = MAX_BATCH_SIZE;
-
-    /* First pass for this batch: work out how much memory to alloc, and detect superpages */
-    nr_mfns = scount = 0;
-    for ( i = 0; i < j; i++ )
-    {
-        unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        /* For allocation purposes, treat XEN_DOMCTL_PFINFO_XALLOC as a normal page */
-        if ( (pagetype != XEN_DOMCTL_PFINFO_XTAB) && 
-             (ctx->p2m[pfn] == INVALID_P2M_ENTRY) )
-        {
-            /* Have a live PFN which hasn't had an MFN allocated */
-
-            /* Logic if we're in the middle of detecting a candidate superpage */
-            if ( superpage_start != INVALID_P2M_ENTRY )
-            {
-                /* Is this the next expected continuation? */
-                if ( pfn == superpage_start + scount )
-                {
-                    if ( !ctx->superpages )
-                    {
-                        ERROR("Unexpexted codepath with no superpages");
-                        return -1;
-                    }
-
-                    scount++;
-
-                    /* If we've found a whole superpage, allocate it and update p2m */
-                    if ( scount  == SUPERPAGE_NR_PFNS )
-                    {
-                        unsigned long supermfn;
-
-
-                        supermfn=superpage_start;
-                        if ( xc_domain_populate_physmap_exact(xch, dom, 1,
-                                         SUPERPAGE_PFN_SHIFT, 0, &supermfn) != 0 )
-                        {
-                            DPRINTF("No 2M page available for pfn 0x%lx, fall back to 4K page.\n",
-                                    superpage_start);
-                            /* If we're falling back from a failed allocation, subtract one
-                             * from count, since the last page == pfn, which will behandled
-                             * anyway. */
-                            scount--;
-                            goto fallback;
-                        }
-
-                        DPRINTF("Mapping superpage (%d) pfn %lx, mfn %lx\n", scount, superpage_start, supermfn);
-                        for (k=0; k<scount; k++)
-                        {
-                            /* We just allocated a new mfn above; update p2m */
-                            ctx->p2m[superpage_start+k] = supermfn+k;
-                            ctx->nr_pfns++;
-                            /* region_map[] will be set below */
-                        }
-                        superpage_start=INVALID_P2M_ENTRY;
-                        scount=0;
-                    }
-                    continue;
-                }
-                
-            fallback:
-                DPRINTF("Falling back %d pages pfn %lx\n", scount, superpage_start);
-                for (k=0; k<scount; k++)
-                {
-                    ctx->p2m_batch[nr_mfns++] = superpage_start+k; 
-                    ctx->p2m[superpage_start+k]--;
-                }
-                superpage_start = INVALID_P2M_ENTRY;
-                scount=0;
-            }
-
-            /* Are we ready to start a new superpage candidate? */
-            if ( ctx->hvm && ctx->superpages && SUPER_PAGE_START(pfn) )
-            {
-                superpage_start=pfn;
-                scount++;
-            }
-            else
-            {
-                /* Add the current pfn to pfn_batch */
-                ctx->p2m_batch[nr_mfns++] = pfn;
-                ctx->p2m[pfn]--;
-            }
-        }
-    }
-
-    /* Clean up any partial superpage candidates */
-    if ( superpage_start != INVALID_P2M_ENTRY )
-    {
-        DPRINTF("Falling back %d pages pfn %lx\n", scount, superpage_start);
-        for (k=0; k<scount; k++)
-        {
-            ctx->p2m_batch[nr_mfns++] = superpage_start+k; 
-            ctx->p2m[superpage_start+k]--;
-        }
-        superpage_start = INVALID_P2M_ENTRY;
-    }
-
-    /* Now allocate a bunch of mfns for this batch */
-    if ( nr_mfns )
-    {
-        DPRINTF("Mapping order 0,  %d; first pfn %lx\n", nr_mfns, ctx->p2m_batch[0]);
-    
-        if (!ctx->hvm && ctx->superpages)
-            rc = alloc_superpage_mfns(xch, dom, ctx, nr_mfns);
-        else
-            rc = xc_domain_populate_physmap_exact(xch, dom, nr_mfns, 0, 0,
-                                                  ctx->p2m_batch);
-
-        if (rc)
-        {
-            ERROR("Failed to allocate memory for batch.!\n"); 
-            errno = ENOMEM;
-            return -1;
-        }
-    }
-
-    /* Second pass for this batch: update p2m[] and region_mfn[] */
-    nr_mfns = 0; 
-    for ( i = 0; i < j; i++ )
-    {
-        unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        if ( pagetype != XEN_DOMCTL_PFINFO_XTAB
-             && ctx->p2m[pfn] == (INVALID_P2M_ENTRY-1) )
-        {
-            /* We just allocated a new mfn above; update p2m */
-            ctx->p2m[pfn] = ctx->p2m_batch[nr_mfns++]; 
-            ctx->nr_pfns++; 
-        }
-
-        /* setup region_mfn[] for batch map, if necessary.
-         * For HVM guests, this interface takes PFNs, not MFNs */
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
-             || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
-            region_mfn[i] = ~0UL; /* map will fail but we don't care */
-        else
-            region_mfn[i] = ctx->hvm ? pfn : ctx->p2m[pfn];
-    }
-
-    /* Map relevant mfns */
-    pfn_err = calloc(j, sizeof(*pfn_err));
-    if ( pfn_err == NULL )
-    {
-        PERROR("allocation for pfn_err failed");
-        return -1;
-    }
-    region_base = xc_map_foreign_bulk(
-        xch, dom, PROT_WRITE, region_mfn, pfn_err, j);
-
-    if ( region_base == NULL )
-    {
-        PERROR("map batch failed");
-        free(pfn_err);
-        return -1;
-    }
-
-    for ( i = 0, curpage = -1; i < j; i++ )
-    {
-        pfn      = pagebuf->pfn_types[i + curbatch] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i + curbatch] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
-
-        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
-             || pagetype == XEN_DOMCTL_PFINFO_XALLOC)
-        {
-            local_invalid_pages++;
-            /* a bogus/unmapped/allocate-only page: skip it */
-            continue;
-        }
-
-        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
-        {
-            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
-            {
-                ERROR("Set p2m for broken page failed, "
-                      "dom=%d, pfn=%lx\n", dom, pfn);
-                goto err_mapped;
-            }
-
-            local_invalid_pages++;
-            continue;
-        }
-
-        if (pfn_err[i])
-        {
-            ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
-                  pfn, region_mfn[i], ctx->p2m[pfn]);
-            goto err_mapped;
-        }
-
-        ++curpage;
-
-        if ( pfn > dinfo->p2m_size )
-        {
-            ERROR("pfn out of range");
-            goto err_mapped;
-        }
-
-        pfn_type[pfn] = pagetype;
-
-        mfn = ctx->p2m[pfn];
-
-        /* In verify mode, we use a copy; otherwise we work in place */
-        page = pagebuf->verify ? (void *)buf : (region_base + i*PAGE_SIZE);
-
-        /* Remus - page decompression */
-        if (pagebuf->compressing)
-        {
-            if (xc_compression_uncompress_page(xch, pagebuf->pages,
-                                               pagebuf->compbuf_size,
-                                               &pagebuf->compbuf_pos,
-                                               (char *)page))
-            {
-                ERROR("Failed to uncompress page (pfn=%lx)\n", pfn);
-                goto err_mapped;
-            }
-        }
-        else
-            memcpy(page, pagebuf->pages + (first_page + curpage) * PAGE_SIZE,
-                   PAGE_SIZE);
-
-        pagetype &= XEN_DOMCTL_PFINFO_LTABTYPE_MASK;
-
-        if ( (pagetype >= XEN_DOMCTL_PFINFO_L1TAB) &&
-             (pagetype <= XEN_DOMCTL_PFINFO_L4TAB) )
-        {
-            /*
-            ** A page table page - need to 'uncanonicalize' it, i.e.
-            ** replace all the references to pfns with the corresponding
-            ** mfns for the new domain.
-            **
-            ** On PAE we need to ensure that PGDs are in MFNs < 4G, and
-            ** so we may need to update the p2m after the main loop.
-            ** Hence we defer canonicalization of L1s until then.
-            */
-            if ((ctx->pt_levels != 3) ||
-                pae_extended_cr3 ||
-                (pagetype != XEN_DOMCTL_PFINFO_L1TAB)) {
-
-                if (!uncanonicalize_pagetable(xch, dom, ctx, page)) {
-                    /*
-                    ** Failing to uncanonicalize a page table can be ok
-                    ** under live migration since the pages type may have
-                    ** changed by now (and we'll get an update later).
-                    */
-                    DPRINTF("PT L%ld race on pfn=%08lx mfn=%08lx\n",
-                            pagetype >> 28, pfn, mfn);
-                    nraces++;
-                    continue;
-                }
-            }
-        }
-        else if ( pagetype != XEN_DOMCTL_PFINFO_NOTAB )
-        {
-            ERROR("Bogus page type %lx page table is out of range: "
-                  "i=%d p2m_size=%lu", pagetype, i, dinfo->p2m_size);
-            goto err_mapped;
-        }
-
-        if ( pagebuf->verify )
-        {
-            int res = memcmp(buf, (region_base + i*PAGE_SIZE), PAGE_SIZE);
-            if ( res )
-            {
-                int v;
-
-                DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx "
-                        "actualcs=%08lx\n", pfn, pfn_type[pfn],
-                        csum_page(region_base + i * PAGE_SIZE),
-                        csum_page(buf));
-
-                for ( v = 0; v < 4; v++ )
-                {
-                    unsigned long *p = (unsigned long *)
-                        (region_base + i*PAGE_SIZE);
-                    if ( buf[v] != p[v] )
-                        DPRINTF("    %d: %08lx %08lx\n", v, buf[v], p[v]);
-                }
-            }
-        }
-
-        if ( !ctx->hvm &&
-             xc_add_mmu_update(xch, mmu,
-                               (((unsigned long long)mfn) << PAGE_SHIFT)
-                               | MMU_MACHPHYS_UPDATE, pfn) )
-        {
-            PERROR("failed machpys update mfn=%lx pfn=%lx", mfn, pfn);
-            goto err_mapped;
-        }
-    } /* end of 'batch' for loop */
-
-    rc = nraces;
-    *invalid_pages += local_invalid_pages;
-
-  err_mapped:
-    munmap(region_base, j*PAGE_SIZE);
-    free(pfn_err);
-
-    return rc;
-}
-
-int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
-                      unsigned int store_evtchn, unsigned long *store_mfn,
-                      domid_t store_domid, unsigned int console_evtchn,
-                      unsigned long *console_mfn, domid_t console_domid,
-                      unsigned int hvm, unsigned int pae, int superpages,
-                      int checkpointed_stream,
-                      struct restore_callbacks *callbacks)
-{
-    DECLARE_DOMCTL;
-    xc_dominfo_t info;
-    int rc = 1, frc, i, j, n, m, pae_extended_cr3 = 0, ext_vcpucontext = 0;
-    uint32_t vcpuextstate_size = 0;
-    unsigned long mfn, pfn;
-    int nraces = 0;
-
-    /* The new domain's shared-info frame number. */
-    unsigned long shared_info_frame;
-    unsigned char shared_info_page[PAGE_SIZE]; /* saved contents from file */
-    shared_info_any_t *old_shared_info = 
-        (shared_info_any_t *)shared_info_page;
-    shared_info_any_t *new_shared_info;
-
-    /* A copy of the CPU context of the guest. */
-    DECLARE_HYPERCALL_BUFFER(vcpu_guest_context_any_t, ctxt);
-
-    /* A copy of the CPU eXtended States of the guest. */
-    DECLARE_HYPERCALL_BUFFER(void, buffer);
-
-    /* A table containing the type of each PFN (/not/ MFN!). */
-    unsigned long *pfn_type = NULL;
-
-    /* A table of MFNs to map in the current region */
-    xen_pfn_t *region_mfn = NULL;
-
-    /* A copy of the pfn-to-mfn table frame list. */
-    xen_pfn_t *p2m_frame_list = NULL;
-    
-    /* A temporary mapping of the guest's start_info page. */
-    start_info_any_t *start_info;
-
-    /* Our mapping of the current region (batch) */
-    char *region_base;
-
-    struct xc_mmu *mmu = NULL;
-
-    struct mmuext_op pin[MAX_PIN_BATCH];
-    unsigned int nr_pins;
-
-    uint64_t vcpumap[XC_SR_MAX_VCPUS/64] = { 1ULL };
-    unsigned int max_vcpu_id = 0;
-    int new_ctxt_format = 0;
-
-    pagebuf_t pagebuf;
-    tailbuf_t tailbuf, tmptail;
-    struct toolstack_data_t tdata, tdatatmp;
-    void* vcpup;
-    uint64_t console_pfn = 0;
-
-    int orig_io_fd_flags;
-
-    struct restore_ctx _ctx;
-    struct restore_ctx *ctx = &_ctx;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    if ( getenv("XG_MIGRATION_V2") )
-    {
-        return xc_domain_restore2(
-            xch, io_fd, dom, store_evtchn, store_mfn,
-            store_domid, console_evtchn, console_mfn, console_domid,
-            hvm,  pae,  superpages, checkpointed_stream, callbacks);
-    }
-
-    DPRINTF("%s: starting restore of new domid %u", __func__, dom);
-
-    pagebuf_init(&pagebuf);
-    memset(&tailbuf, 0, sizeof(tailbuf));
-    tailbuf.ishvm = hvm;
-    memset(&tdata, 0, sizeof(tdata));
-
-    memset(ctx, 0, sizeof(*ctx));
-
-    ctx->superpages = superpages;
-    ctx->hvm = hvm;
-    ctx->last_checkpoint = !checkpointed_stream;
-
-    ctxt = xc_hypercall_buffer_alloc(xch, ctxt, sizeof(*ctxt));
-
-    if ( ctxt == NULL )
-    {
-        PERROR("Unable to allocate VCPU ctxt buffer");
-        return 1;
-    }
-
-
-    if ( (orig_io_fd_flags = fcntl(io_fd, F_GETFL, 0)) < 0 ) {
-        PERROR("unable to read IO FD flags");
-        goto out;
-    }
-
-    if ( RDEXACT(io_fd, &dinfo->p2m_size, sizeof(unsigned long)) )
-    {
-        PERROR("read: p2m_size");
-        goto out;
-    }
-    DPRINTF("%s: p2m_size = %lx\n", __func__, dinfo->p2m_size);
-
-    if ( !get_platform_info(xch, dom,
-                            &ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) )
-    {
-        ERROR("Unable to get platform info.");
-        return 1;
-    }
-    
-    /* The *current* word size of the guest isn't very interesting; for now
-     * assume the guest will be the same as we are.  We'll fix that later
-     * if we discover otherwise. */
-    dinfo->guest_width = sizeof(unsigned long);
-    ctx->pt_levels = (dinfo->guest_width == 8) ? 4 : 3;
-    
-    if ( !hvm ) 
-    {
-        /* Load the p2m frame list, plus potential extended info chunk */
-        p2m_frame_list = load_p2m_frame_list(xch, ctx,
-            io_fd, &pae_extended_cr3, &ext_vcpucontext,
-            &vcpuextstate_size);
-
-        if ( !p2m_frame_list )
-            goto out;
-
-        /* Now that we know the word size, tell Xen about it */
-        memset(&domctl, 0, sizeof(domctl));
-        domctl.domain = dom;
-        domctl.cmd    = XEN_DOMCTL_set_address_size;
-        domctl.u.address_size.size = dinfo->guest_width * 8;
-        frc = do_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Unable to set guest address size.");
-            goto out;
-        }
-    }
-
-    /* We want zeroed memory so use calloc rather than malloc. */
-    ctx->p2m   = calloc(dinfo->p2m_size, sizeof(xen_pfn_t));
-    pfn_type   = calloc(dinfo->p2m_size, sizeof(unsigned long));
-
-    region_mfn = malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-    ctx->p2m_batch = malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-    if (!ctx->hvm && ctx->superpages)
-    {
-        ctx->p2m_saved_batch =
-            malloc(ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT));
-        if ( ctx->p2m_saved_batch == NULL )
-        {
-            ERROR("saved batch memory alloc failed");
-            errno = ENOMEM;
-            goto out;
-        }
-    }
-
-    if ( (ctx->p2m == NULL) || (pfn_type == NULL) ||
-         (region_mfn == NULL) || (ctx->p2m_batch == NULL) )
-    {
-        ERROR("memory alloc failed");
-        errno = ENOMEM;
-        goto out;
-    }
-
-    memset(region_mfn, 0,
-           ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT)); 
-    memset(ctx->p2m_batch, 0,
-           ROUNDUP(MAX_BATCH_SIZE * sizeof(xen_pfn_t), PAGE_SHIFT)); 
-
-    /* Get the domain's shared-info frame. */
-    if ( xc_domain_getinfo(xch, (domid_t)dom, 1, &info) != 1 )
-    {
-        PERROR("Could not get information on new domain");
-        goto out;
-    }
-    shared_info_frame = info.shared_info_frame;
-
-    /* Mark all PFNs as invalid; we allocate on demand */
-    for ( pfn = 0; pfn < dinfo->p2m_size; pfn++ )
-        ctx->p2m[pfn] = INVALID_P2M_ENTRY;
-
-    mmu = xc_alloc_mmu_updates(xch, dom);
-    if ( mmu == NULL )
-    {
-        PERROR("Could not initialise for MMU updates");
-        goto out;
-    }
-
-    xc_set_progress_prefix(xch, "Reloading memory pages");
-    xc_report_progress_step(xch, 0, dinfo->p2m_size);
-
-    /*
-     * Now simply read each saved frame into its new machine frame.
-     * We uncanonicalise page tables as we go.
-     */
-
-    n = m = 0;
- loadpages:
-    for ( ; ; )
-    {
-        int j, curbatch, invalid_pages;
-
-        xc_report_progress_step(xch, n, dinfo->p2m_size);
-
-        if ( !ctx->completed ) {
-            pagebuf.nr_physpages = pagebuf.nr_pages = 0;
-            pagebuf.compbuf_pos = pagebuf.compbuf_size = 0;
-            if ( pagebuf_get_one(xch, ctx, &pagebuf, io_fd, dom) < 0 ) {
-                PERROR("Error when reading batch");
-                goto out;
-            }
-        }
-        j = pagebuf.nr_pages;
-
-        DBGPRINTF("batch %d\n",j);
-
-        if ( j == 0 ) {
-            /* catch vcpu updates */
-            if (pagebuf.new_ctxt_format) {
-                max_vcpu_id = pagebuf.max_vcpu_id;
-                memcpy(vcpumap, pagebuf.vcpumap, vcpumap_sz(max_vcpu_id));
-            }
-            /* should this be deferred? does it change? */
-            if ( pagebuf.identpt )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT, pagebuf.identpt);
-            if ( pagebuf.paging_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_PAGING_RING_PFN, pagebuf.paging_ring_pfn);
-            if ( pagebuf.monitor_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_MONITOR_RING_PFN, pagebuf.monitor_ring_pfn);
-            if ( pagebuf.sharing_ring_pfn )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_SHARING_RING_PFN, pagebuf.sharing_ring_pfn);
-            if ( pagebuf.vm86_tss )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
-            if ( pagebuf.console_pfn )
-                console_pfn = pagebuf.console_pfn;
-            if ( pagebuf.vm_generationid_addr )
-                xc_hvm_param_set(xch, dom, HVM_PARAM_VM_GENERATION_ID_ADDR,
-                                 pagebuf.vm_generationid_addr);
-
-            break;  /* our work here is done */
-        }
-
-        /* break pagebuf into batches */
-        curbatch = 0;
-        invalid_pages = 0;
-        while ( curbatch < j ) {
-            int brc;
-
-            brc = apply_batch(xch, dom, ctx, region_mfn, pfn_type,
-                              pae_extended_cr3, mmu, &pagebuf, curbatch,
-                              &invalid_pages);
-            if ( brc < 0 )
-                goto out;
-
-            nraces += brc;
-
-            curbatch += MAX_BATCH_SIZE;
-        }
-
-        pagebuf.nr_physpages = pagebuf.nr_pages = 0;
-        pagebuf.compbuf_pos = pagebuf.compbuf_size = 0;
-
-        n += j; /* crude stats */
-
-        /* 
-         * Discard cache for portion of file read so far up to last
-         *  page boundary every 16MB or so.
-         */
-        m += j;
-        if ( m > MAX_PAGECACHE_USAGE )
-        {
-            discard_file_cache(xch, io_fd, 0 /* no flush */);
-            m = 0;
-        }
-    }
-
-    /*
-     * Ensure we flush all machphys updates before potential PAE-specific
-     * reallocations below.
-     */
-    if ( !hvm && xc_flush_mmu_updates(xch, mmu) )
-    {
-        PERROR("Error doing flush_mmu_updates()");
-        goto out;
-    }
-
-    // DPRINTF("Received all pages (%d races)\n", nraces);
-
-    if ( !ctx->completed ) {
-
-        if ( buffer_tail(xch, ctx, &tailbuf, io_fd, max_vcpu_id, vcpumap,
-                         ext_vcpucontext, vcpuextstate_size) < 0 ) {
-            ERROR ("error buffering image tail");
-            goto out;
-        }
-
-        ctx->completed = 1;
-
-        /*
-         * If more checkpoints are expected then shift into
-         * nonblocking mode for the remainder.
-         */
-        if ( !ctx->last_checkpoint )
-            fcntl(io_fd, F_SETFL, orig_io_fd_flags | O_NONBLOCK);
-
-        /*
-         * If sender had sent enable compression flag, switch to compressed
-         * checkpoints mode once the first checkpoint is received.
-         */
-        if (ctx->compressing)
-            pagebuf.compressing = 1;
-    }
-
-    if (pagebuf.viridian != 0)
-        xc_hvm_param_set(xch, dom, HVM_PARAM_VIRIDIAN, pagebuf.viridian);
-
-    /*
-     * If we are migrating in from a host that does not support
-     * secondary emulators then nr_ioreq_server_pages will be 0, since
-     * there will be no XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk in
-     * the image.
-     * If we are migrating from a host that does support secondary
-     * emulators then the XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk
-     * will exist and is guaranteed to have a non-zero value. The
-     * existence of that chunk also implies the existence of the
-     * XC_SAVE_ID_HVM_IOREQ_SERVER_PFN chunk, which is also guaranteed
-     * to have a non-zero value.
-     */
-    if (!pagebuf.nr_ioreq_server_pages ^ !pagebuf.ioreq_server_pfn) {
-        ERROR("Inconsistent IOREQ Server settings (nr=%"PRIx64", pfn=%"PRIx64")",
-              pagebuf.nr_ioreq_server_pages, pagebuf.ioreq_server_pfn);
-    } else {
-        if (pagebuf.nr_ioreq_server_pages != 0 &&
-            pagebuf.ioreq_server_pfn != 0) {
-            xc_hvm_param_set(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
-                             pagebuf.nr_ioreq_server_pages);
-            xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
-                             pagebuf.ioreq_server_pfn);
-        }
-    }
-
-    if (pagebuf.acpi_ioport_location == 1) {
-        DBGPRINTF("Use new firmware ioport from the checkpoint\n");
-        xc_hvm_param_set(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
-    } else if (pagebuf.acpi_ioport_location == 0) {
-        DBGPRINTF("Use old firmware ioport from the checkpoint\n");
-    } else {
-        ERROR("Error, unknow acpi ioport location (%"PRId64")", pagebuf.acpi_ioport_location);
-    }
-
-    tdatatmp = tdata;
-    tdata = pagebuf.tdata;
-    pagebuf.tdata = tdatatmp;
-
-    if ( ctx->last_checkpoint )
-    {
-        // DPRINTF("Last checkpoint, finishing\n");
-        goto finish;
-    }
-
-    // DPRINTF("Buffered checkpoint\n");
-
-    if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
-        PERROR("error when buffering batch, finishing");
-        /*
-         * Remus: discard the current incomplete checkpoint and restore
-         * backup from the last complete checkpoint.
-         */
-        goto finish;
-    }
-    memset(&tmptail, 0, sizeof(tmptail));
-    tmptail.ishvm = hvm;
-    if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
-                     ext_vcpucontext, vcpuextstate_size) < 0 ) {
-        ERROR ("error buffering image tail, finishing");
-        /*
-         * Remus: discard the current incomplete checkpoint and restore
-         * backup from the last complete checkpoint.
-         */
-        goto finish;
-    }
-    tailbuf_free(&tailbuf);
-    memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
-
-    goto loadpages;
-
-  /* With Remus: restore from last complete checkpoint */
-  finish:
-    if ( hvm )
-        goto finish_hvm;
-
-    if ( (ctx->pt_levels == 3) && !pae_extended_cr3 )
-    {
-        /*
-        ** XXX SMH on PAE we need to ensure PGDs are in MFNs < 4G. This
-        ** is a little awkward and involves (a) finding all such PGDs and
-        ** replacing them with 'lowmem' versions; (b) upating the p2m[]
-        ** with the new info; and (c) canonicalizing all the L1s using the
-        ** (potentially updated) p2m[].
-        **
-        ** This is relatively slow (and currently involves two passes through
-        ** the pfn_type[] array), but at least seems to be correct. May wish
-        ** to consider more complex approaches to optimize this later.
-        */
-
-        int j, k;
-        
-        /* First pass: find all L3TABs current in > 4G mfns and get new mfns */
-        for ( i = 0; i < dinfo->p2m_size; i++ )
-        {
-            if ( ((pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ==
-                  XEN_DOMCTL_PFINFO_L3TAB) &&
-                 (ctx->p2m[i] > 0xfffffUL) )
-            {
-                unsigned long new_mfn;
-                uint64_t l3ptes[4];
-                uint64_t *l3tab;
-
-                l3tab = (uint64_t *)
-                    xc_map_foreign_range(xch, dom, PAGE_SIZE,
-                                         PROT_READ, ctx->p2m[i]);
-                if ( l3tab == NULL )
-                {
-                    PERROR("xc_map_foreign_range failed (for l3tab)");
-                    goto out;
-                }
-
-                for ( j = 0; j < 4; j++ )
-                    l3ptes[j] = l3tab[j];
-
-                munmap(l3tab, PAGE_SIZE);
-
-                new_mfn = xc_make_page_below_4G(xch, dom, ctx->p2m[i]);
-                if ( !new_mfn )
-                {
-                    PERROR("Couldn't get a page below 4GB :-(");
-                    goto out;
-                }
-
-                ctx->p2m[i] = new_mfn;
-                if ( xc_add_mmu_update(xch, mmu,
-                                       (((unsigned long long)new_mfn)
-                                        << PAGE_SHIFT) |
-                                       MMU_MACHPHYS_UPDATE, i) )
-                {
-                    PERROR("Couldn't m2p on PAE root pgdir");
-                    goto out;
-                }
-
-                l3tab = (uint64_t *)
-                    xc_map_foreign_range(xch, dom, PAGE_SIZE,
-                                         PROT_READ | PROT_WRITE, ctx->p2m[i]);
-                if ( l3tab == NULL )
-                {
-                    PERROR("xc_map_foreign_range failed (for l3tab, 2nd)");
-                    goto out;
-                }
-
-                for ( j = 0; j < 4; j++ )
-                    l3tab[j] = l3ptes[j];
-
-                munmap(l3tab, PAGE_SIZE);
-            }
-        }
-
-        /* Second pass: find all L1TABs and uncanonicalize them */
-        j = 0;
-
-        for ( i = 0; i < dinfo->p2m_size; i++ )
-        {
-            if ( ((pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ==
-                  XEN_DOMCTL_PFINFO_L1TAB) )
-            {
-                region_mfn[j] = ctx->p2m[i];
-                j++;
-            }
-
-            if ( (i == (dinfo->p2m_size-1)) || (j == MAX_BATCH_SIZE) )
-            {
-                region_base = xc_map_foreign_pages(
-                    xch, dom, PROT_READ | PROT_WRITE, region_mfn, j);
-                if ( region_base == NULL )
-                {
-                    PERROR("map batch failed");
-                    goto out;
-                }
-
-                for ( k = 0; k < j; k++ )
-                {
-                    if ( !uncanonicalize_pagetable(
-                        xch, dom, ctx,
-                        region_base + k*PAGE_SIZE) )
-                    {
-                        ERROR("failed uncanonicalize pt!");
-                        goto out;
-                    }
-                }
-
-                munmap(region_base, j*PAGE_SIZE);
-                j = 0;
-            }
-        }
-
-        if ( xc_flush_mmu_updates(xch, mmu) )
-        {
-            PERROR("Error doing xc_flush_mmu_updates()");
-            goto out;
-        }
-    }
-
-    /*
-     * Pin page tables. Do this after writing to them as otherwise Xen
-     * will barf when doing the type-checking.
-     */
-    nr_pins = 0;
-    for ( i = 0; i < dinfo->p2m_size; i++ )
-    {
-        if ( (pfn_type[i] & XEN_DOMCTL_PFINFO_LPINTAB) == 0 )
-            continue;
-
-        switch ( pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK )
-        {
-        case XEN_DOMCTL_PFINFO_L1TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L2TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L3TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L3_TABLE;
-            break;
-
-        case XEN_DOMCTL_PFINFO_L4TAB:
-            pin[nr_pins].cmd = MMUEXT_PIN_L4_TABLE;
-            break;
-
-        default:
-            continue;
-        }
-
-        pin[nr_pins].arg1.mfn = ctx->p2m[i];
-        nr_pins++;
-
-        /* Batch full? Then flush. */
-        if ( nr_pins == MAX_PIN_BATCH )
-        {
-            if ( xc_mmuext_op(xch, pin, nr_pins, dom) < 0 )
-            {
-                PERROR("Failed to pin batch of %d page tables", nr_pins);
-                goto out;
-            }
-            nr_pins = 0;
-        }
-    }
-
-    /* Flush final partial batch. */
-    if ( (nr_pins != 0) && (xc_mmuext_op(xch, pin, nr_pins, dom) < 0) )
-    {
-        PERROR("Failed to pin batch of %d page tables", nr_pins);
-        goto out;
-    }
-
-    DPRINTF("Memory reloaded (%ld pages)\n", ctx->nr_pfns);
-
-    /* Get the list of PFNs that are not in the psuedo-phys map */
-    {
-        int nr_frees = 0;
-
-        for ( i = 0; i < tailbuf.u.pv.pfncount; i++ )
-        {
-            unsigned long pfn = tailbuf.u.pv.pfntab[i];
-
-            if ( ctx->p2m[pfn] != INVALID_P2M_ENTRY )
-            {
-                /* pfn is not in physmap now, but was at some point during
-                   the save/migration process - need to free it */
-                tailbuf.u.pv.pfntab[nr_frees++] = ctx->p2m[pfn];
-                ctx->p2m[pfn]  = INVALID_P2M_ENTRY; /* not in pseudo-physical map */
-            }
-        }
-
-        if ( nr_frees > 0 )
-        {
-            if ( (frc = xc_domain_decrease_reservation(xch, dom, nr_frees, 0, tailbuf.u.pv.pfntab)) != nr_frees )
-            {
-                PERROR("Could not decrease reservation : %d", frc);
-                goto out;
-            }
-            else
-                DPRINTF("Decreased reservation by %d pages\n", tailbuf.u.pv.pfncount);
-        }
-    }
-
-    vcpup = tailbuf.u.pv.vcpubuf;
-    for ( i = 0; i <= max_vcpu_id; i++ )
-    {
-        if ( !(vcpumap[i/64] & (1ULL << (i%64))) )
-            continue;
-
-        memcpy(ctxt, vcpup, ((dinfo->guest_width == 8) ? sizeof(ctxt->x64)
-                              : sizeof(ctxt->x32)));
-        vcpup += (dinfo->guest_width == 8) ? sizeof(ctxt->x64) : sizeof(ctxt->x32);
-
-        DPRINTF("read VCPU %d\n", i);
-
-        if ( !new_ctxt_format )
-            SET_FIELD(ctxt, flags,
-                      GET_FIELD(ctxt, flags, dinfo->guest_width) | VGCF_online,
-                      dinfo->guest_width);
-
-        if ( i == 0 )
-        {
-            /*
-             * Uncanonicalise the start info frame number and poke in
-             * updated values into the start info itself.
-             *
-             * The start info MFN is the 3rd argument to the
-             * HYPERVISOR_sched_op hypercall when op==SCHEDOP_shutdown
-             * and reason==SHUTDOWN_suspend, it is canonicalised in
-             * xc_domain_save and therefore the PFN is found in the
-             * edx register.
-             */
-            pfn = GET_FIELD(ctxt, user_regs.edx, dinfo->guest_width);
-            if ( (pfn >= dinfo->p2m_size) ||
-                 (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-            {
-                ERROR("Suspend record frame number is bad");
-                goto out;
-            }
-            mfn = ctx->p2m[pfn];
-            SET_FIELD(ctxt, user_regs.edx, mfn, dinfo->guest_width);
-            start_info = xc_map_foreign_range(
-                xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, mfn);
-            if ( start_info == NULL )
-            {
-                PERROR("xc_map_foreign_range failed (for start_info)");
-                goto out;
-            }
-
-            SET_FIELD(start_info, nr_pages, dinfo->p2m_size, dinfo->guest_width);
-            SET_FIELD(start_info, shared_info, shared_info_frame<<PAGE_SHIFT, dinfo->guest_width);
-            SET_FIELD(start_info, flags, 0, dinfo->guest_width);
-            if ( GET_FIELD(start_info, store_mfn, dinfo->guest_width) > dinfo->p2m_size )
-            {
-                ERROR("Suspend record xenstore frame number is bad");
-                munmap(start_info, PAGE_SIZE);
-                goto out;
-            }
-            *store_mfn = ctx->p2m[GET_FIELD(start_info, store_mfn, dinfo->guest_width)];
-            SET_FIELD(start_info, store_mfn, *store_mfn, dinfo->guest_width);
-            SET_FIELD(start_info, store_evtchn, store_evtchn, dinfo->guest_width);
-            if ( GET_FIELD(start_info, console.domU.mfn, dinfo->guest_width) > dinfo->p2m_size )
-            {
-                ERROR("Suspend record console frame number is bad");
-                munmap(start_info, PAGE_SIZE);
-                goto out;
-            }
-            *console_mfn = ctx->p2m[GET_FIELD(start_info, console.domU.mfn, dinfo->guest_width)];
-            SET_FIELD(start_info, console.domU.mfn, *console_mfn, dinfo->guest_width);
-            SET_FIELD(start_info, console.domU.evtchn, console_evtchn, dinfo->guest_width);
-            munmap(start_info, PAGE_SIZE);
-        }
-        /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents, dinfo->guest_width) > 8192 )
-        {
-            ERROR("GDT entry count out of range");
-            goto out;
-        }
-
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents, dinfo->guest_width); j++ )
-        {
-            pfn = GET_FIELD(ctxt, gdt_frames[j], dinfo->guest_width);
-            if ( (pfn >= dinfo->p2m_size) ||
-                 (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-            {
-                ERROR("GDT frame number %i (0x%lx) is bad", 
-                      j, (unsigned long)pfn);
-                goto out;
-            }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn], dinfo->guest_width);
-        }
-        /* Uncanonicalise the page table base pointer. */
-        pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3], dinfo->guest_width));
-
-        if ( pfn >= dinfo->p2m_size )
-        {
-            ERROR("PT base is bad: pfn=%lu p2m_size=%lu type=%08lx",
-                  pfn, dinfo->p2m_size, pfn_type[pfn]);
-            goto out;
-        }
-
-        if ( (pfn_type[pfn] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) !=
-             ((unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT) )
-        {
-            ERROR("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx",
-                  pfn, dinfo->p2m_size, pfn_type[pfn],
-                  (unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT);
-            goto out;
-        }
-        SET_FIELD(ctxt, ctrlreg[3], FOLD_CR3(ctx->p2m[pfn]), dinfo->guest_width);
-
-        /* Guest pagetable (x86/64) stored in otherwise-unused CR1. */
-        if ( (ctx->pt_levels == 4) && (ctxt->x64.ctrlreg[1] & 1) )
-        {
-            pfn = UNFOLD_CR3(ctxt->x64.ctrlreg[1] & ~1);
-            if ( pfn >= dinfo->p2m_size )
-            {
-                ERROR("User PT base is bad: pfn=%lu p2m_size=%lu",
-                      pfn, dinfo->p2m_size);
-                goto out;
-            }
-            if ( (pfn_type[pfn] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) !=
-                 ((unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT) )
-            {
-                ERROR("User PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx",
-                      pfn, dinfo->p2m_size, pfn_type[pfn],
-                      (unsigned long)ctx->pt_levels<<XEN_DOMCTL_PFINFO_LTAB_SHIFT);
-                goto out;
-            }
-            ctxt->x64.ctrlreg[1] = FOLD_CR3(ctx->p2m[pfn]);
-        }
-        frc = xc_vcpu_setcontext(xch, dom, i, ctxt);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't build vcpu%d", i);
-            goto out;
-        }
-
-        if ( !ext_vcpucontext )
-            goto vcpu_ext_state_restore;
-        memcpy(&domctl.u.ext_vcpucontext, vcpup, 128);
-        vcpup += 128;
-        domctl.cmd = XEN_DOMCTL_set_ext_vcpucontext;
-        domctl.domain = dom;
-        frc = xc_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't set extended vcpu%d info", i);
-            goto out;
-        }
-
- vcpu_ext_state_restore:
-        if ( !vcpuextstate_size )
-            continue;
-
-        memcpy(&domctl.u.vcpuextstate.xfeature_mask, vcpup,
-               sizeof(domctl.u.vcpuextstate.xfeature_mask));
-        vcpup += sizeof(domctl.u.vcpuextstate.xfeature_mask);
-        memcpy(&domctl.u.vcpuextstate.size, vcpup,
-               sizeof(domctl.u.vcpuextstate.size));
-        vcpup += sizeof(domctl.u.vcpuextstate.size);
-
-        buffer = xc_hypercall_buffer_alloc(xch, buffer,
-                                           domctl.u.vcpuextstate.size);
-        if ( !buffer )
-        {
-            PERROR("Could not allocate buffer to restore eXtended States");
-            goto out;
-        }
-        memcpy(buffer, vcpup, domctl.u.vcpuextstate.size);
-        vcpup += domctl.u.vcpuextstate.size;
-
-        domctl.cmd = XEN_DOMCTL_setvcpuextstate;
-        domctl.domain = dom;
-        domctl.u.vcpuextstate.vcpu = i;
-        set_xen_guest_handle(domctl.u.vcpuextstate.buffer, buffer);
-        frc = xc_domctl(xch, &domctl);
-        if ( frc != 0 )
-        {
-            PERROR("Couldn't set eXtended States for vcpu%d", i);
-            goto out;
-        }
-        xc_hypercall_buffer_free(xch, buffer);
-    }
-
-    memcpy(shared_info_page, tailbuf.u.pv.shared_info_page, PAGE_SIZE);
-
-    DPRINTF("Completed checkpoint load\n");
-
-    /* Restore contents of shared-info page. No checking needed. */
-    new_shared_info = xc_map_foreign_range(
-        xch, dom, PAGE_SIZE, PROT_WRITE, shared_info_frame);
-    if ( new_shared_info == NULL )
-    {
-        PERROR("xc_map_foreign_range failed (for new_shared_info)");
-        goto out;
-    }
-
-    /* restore saved vcpu_info and arch specific info */
-    MEMCPY_FIELD(new_shared_info, old_shared_info, vcpu_info, dinfo->guest_width);
-    MEMCPY_FIELD(new_shared_info, old_shared_info, arch, dinfo->guest_width);
-
-    /* clear any pending events and the selector */
-    MEMSET_ARRAY_FIELD(new_shared_info, evtchn_pending, 0, dinfo->guest_width);
-    for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
-	    SET_FIELD(new_shared_info, vcpu_info[i].evtchn_pending_sel, 0, dinfo->guest_width);
-
-    /* mask event channels */
-    MEMSET_ARRAY_FIELD(new_shared_info, evtchn_mask, 0xff, dinfo->guest_width);
-
-    /* leave wallclock time. set by hypervisor */
-    munmap(new_shared_info, PAGE_SIZE);
-
-    /* Uncanonicalise the pfn-to-mfn table frame-number list. */
-    for ( i = 0; i < P2M_FL_ENTRIES; i++ )
-    {
-        pfn = p2m_frame_list[i];
-        if ( (pfn >= dinfo->p2m_size) || (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
-        {
-            ERROR("PFN-to-MFN frame number %i (%#lx) is bad", i, pfn);
-            goto out;
-        }
-        p2m_frame_list[i] = ctx->p2m[pfn];
-    }
-
-    /* Copy the P2M we've constructed to the 'live' P2M */
-    if ( !(ctx->live_p2m = xc_map_foreign_pages(xch, dom, PROT_WRITE,
-                                           p2m_frame_list, P2M_FL_ENTRIES)) )
-    {
-        PERROR("Couldn't map p2m table");
-        goto out;
-    }
-
-    /* If the domain we're restoring has a different word size to ours,
-     * we need to adjust the live_p2m assignment appropriately */
-    if ( dinfo->guest_width > sizeof (xen_pfn_t) )
-        for ( i = dinfo->p2m_size - 1; i >= 0; i-- )
-            ((int64_t *)ctx->live_p2m)[i] = (long)ctx->p2m[i];
-    else if ( dinfo->guest_width < sizeof (xen_pfn_t) )
-        for ( i = 0; i < dinfo->p2m_size; i++ )   
-            ((uint32_t *)ctx->live_p2m)[i] = ctx->p2m[i];
-    else
-        memcpy(ctx->live_p2m, ctx->p2m, dinfo->p2m_size * sizeof(xen_pfn_t));
-    munmap(ctx->live_p2m, P2M_FL_ENTRIES * PAGE_SIZE);
-
-    frc = xc_dom_gnttab_seed(xch, dom, *console_mfn, *store_mfn,
-                             console_domid, store_domid);
-    if (frc != 0)
-    {
-        ERROR("error seeding grant table");
-        goto out;
-    }
-
-    DPRINTF("Domain ready to be built.\n");
-    rc = 0;
-    goto out;
-
-  finish_hvm:
-    if ( tdata.data != NULL )
-    {
-        if ( callbacks != NULL && callbacks->toolstack_restore != NULL )
-        {
-            frc = callbacks->toolstack_restore(dom, tdata.data, tdata.len,
-                                               callbacks->data);
-            free(tdata.data);
-            if ( frc < 0 )
-            {
-                PERROR("error calling toolstack_restore");
-                goto out;
-            }
-        } else {
-            rc = -1;
-            ERROR("toolstack data available but no callback provided\n");
-            free(tdata.data);
-            goto out;
-        }
-    }
-
-    /* Dump the QEMU state to a state file for QEMU to load */
-    if ( dump_qemu(xch, dom, &tailbuf.u.hvm) ) {
-        PERROR("Error dumping QEMU state to file");
-        goto out;
-    }
-
-    /* These comms pages need to be zeroed at the start of day */
-    if ( xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[0]) ||
-         xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[1]) ||
-         xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[2]) )
-    {
-        PERROR("error zeroing magic pages");
-        goto out;
-    }
-
-    if ( (frc = xc_hvm_param_set(xch, dom,
-                                 HVM_PARAM_IOREQ_PFN, tailbuf.u.hvm.magicpfns[0]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_BUFIOREQ_PFN, tailbuf.u.hvm.magicpfns[1]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_STORE_PFN, tailbuf.u.hvm.magicpfns[2]))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_PAE_ENABLED, pae))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn))
-         || (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_CONSOLE_EVTCHN,
-                                    console_evtchn)) )
-    {
-        PERROR("error setting HVM params: %i", frc);
-        goto out;
-    }
-    *store_mfn = tailbuf.u.hvm.magicpfns[2];
-
-    if ( console_pfn ) {
-        if ( xc_clear_domain_page(xch, dom, console_pfn) ) {
-            PERROR("error zeroing console page");
-            goto out;
-        }
-        if ( (frc = xc_hvm_param_set(xch, dom,
-                                    HVM_PARAM_CONSOLE_PFN, console_pfn)) ) {
-            PERROR("error setting HVM param: %i", frc);
-            goto out;
-        }
-        *console_mfn = console_pfn;
-    }
-
-    frc = xc_domain_hvm_setcontext(xch, dom, tailbuf.u.hvm.hvmbuf,
-                                   tailbuf.u.hvm.reclen);
-    if ( frc )
-    {
-        PERROR("error setting the HVM context");
-        goto out;
-    }
-
-    frc = xc_dom_gnttab_hvm_seed(xch, dom, *console_mfn, *store_mfn,
-                                 console_domid, store_domid);
-    if (frc != 0)
-    {
-        ERROR("error seeding grant table");
-        goto out;
-    }
-
-    /* HVM success! */
-    rc = 0;
-
- out:
-    if ( (rc != 0) && (dom != 0) )
-        xc_domain_destroy(xch, dom);
-    xc_hypercall_buffer_free(xch, ctxt);
-    free(mmu);
-    free(ctx->p2m);
-    free(pfn_type);
-    free(region_mfn);
-    free(ctx->p2m_batch);
-    pagebuf_free(&pagebuf);
-    tailbuf_free(&tailbuf);
-
-    /* discard cache for save file  */
-    discard_file_cache(xch, io_fd, 1 /*flush*/);
-
-    fcntl(io_fd, F_SETFL, orig_io_fd_flags);
-
-    DPRINTF("Restore exit of domid %u with rc=%d\n", dom, rc);
-
-    return rc;
-}
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
deleted file mode 100644
index 3222473..0000000
--- a/tools/libxc/xc_domain_save.c
+++ /dev/null
@@ -1,2198 +0,0 @@
-/******************************************************************************
- * xc_linux_save.c
- *
- * Save the state of a running Linux session.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Copyright (c) 2003, K A Fraser.
- */
-
-#include <inttypes.h>
-#include <time.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <assert.h>
-
-#include "xc_private.h"
-#include "xc_bitops.h"
-#include "xc_dom.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
-
-#include <xen/hvm/params.h>
-
-/*
-** Default values for important tuning parameters. Can override by passing
-** non-zero replacement values to xc_domain_save().
-**
-** XXX SMH: should consider if want to be able to override MAX_MBIT_RATE too.
-**
-*/
-#define DEF_MAX_ITERS   29   /* limit us to 30 times round loop   */
-#define DEF_MAX_FACTOR   3   /* never send more than 3x p2m_size  */
-
-struct save_ctx {
-    unsigned long hvirt_start; /* virtual starting address of the hypervisor */
-    unsigned int pt_levels; /* #levels of page tables used by the current guest */
-    unsigned long max_mfn; /* max mfn of the whole machine */
-    xen_pfn_t *live_p2m; /* Live mapping of the table mapping each PFN to its current MFN. */
-    xen_pfn_t *live_m2p; /* Live mapping of system MFN to PFN table. */
-    unsigned long m2p_mfn0;
-    struct domain_info_context dinfo;
-};
-
-/* buffer for output */
-struct outbuf {
-    void* buf;
-    size_t size;
-    size_t pos;
-    int write_count;
-};
-
-#define OUTBUF_SIZE (16384 * 1024)
-
-/* grep fodder: machine_to_phys */
-
-#define mfn_to_pfn(_mfn)  (ctx->live_m2p[(_mfn)])
-
-#define pfn_to_mfn(_pfn)                                            \
-  ((xen_pfn_t) ((dinfo->guest_width==8)                               \
-                ? (((uint64_t *)ctx->live_p2m)[(_pfn)])                  \
-                : ((((uint32_t *)ctx->live_p2m)[(_pfn)]) == 0xffffffffU  \
-                   ? (-1UL) : (((uint32_t *)ctx->live_p2m)[(_pfn)]))))
-
-/*
- * Returns TRUE if the given machine frame number has a unique mapping
- * in the guest's pseudophysical map.
- */
-#define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn)          \
-    (((_mfn) < (ctx->max_mfn)) &&                \
-     ((mfn_to_pfn(_mfn) < (dinfo->p2m_size)) &&   \
-      (pfn_to_mfn(mfn_to_pfn(_mfn)) == (_mfn))))
-
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
-
-#define SUPER_PAGE_START(pfn)    (((pfn) & (SUPERPAGE_NR_PFNS-1)) == 0 )
-
-static uint64_t tv_to_us(struct timeval *new)
-{
-    return (new->tv_sec * 1000000) + new->tv_usec;
-}
-
-static uint64_t llgettimeofday(void)
-{
-    struct timeval now;
-    gettimeofday(&now, NULL);
-    return tv_to_us(&now);
-}
-
-static uint64_t tv_delta(struct timeval *new, struct timeval *old)
-{
-    return (((new->tv_sec - old->tv_sec)*1000000) +
-            (new->tv_usec - old->tv_usec));
-}
-
-static int noncached_write(xc_interface *xch,
-                           struct outbuf* ob,
-                           int fd, void *buffer, int len) 
-{
-    int rc = (write_exact(fd, buffer, len) == 0) ? len : -1;
-
-    ob->write_count += len;
-    if ( ob->write_count >= (MAX_PAGECACHE_USAGE * PAGE_SIZE) )
-    {
-        /* Time to discard cache - dont care if this fails */
-        int saved_errno = errno;
-        discard_file_cache(xch, fd, 0 /* no flush */);
-        errno = saved_errno;
-        ob->write_count = 0;
-    }
-
-    return rc;
-}
-
-static int outbuf_init(xc_interface *xch, struct outbuf* ob, size_t size)
-{
-    memset(ob, 0, sizeof(*ob));
-
-    if ( !(ob->buf = malloc(size)) ) {
-        DPRINTF("error allocating output buffer of size %zu\n", size);
-        return -1;
-    }
-
-    ob->size = size;
-
-    return 0;
-}
-
-static int outbuf_free(struct outbuf *ob)
-{
-    free(ob->buf);
-    ob->buf = NULL;
-    return 0;
-}
-
-static inline int outbuf_write(xc_interface *xch,
-                               struct outbuf* ob, void* buf, size_t len)
-{
-    if ( len > ob->size - ob->pos ) {
-        errno = ERANGE;
-        DBGPRINTF("outbuf_write: %zu > %zu@%zu\n", len, ob->size - ob->pos, ob->pos);
-        return -1;
-    }
-
-    memcpy(ob->buf + ob->pos, buf, len);
-    ob->pos += len;
-
-    return 0;
-}
-
-/* prep for nonblocking I/O */
-static int outbuf_flush(xc_interface *xch, struct outbuf* ob, int fd)
-{
-    int rc;
-    int cur = 0;
-
-    if ( !ob->pos )
-        return 0;
-
-    rc = write(fd, ob->buf, ob->pos);
-    while (rc < 0 || cur + rc < ob->pos) {
-        if (rc < 0 && errno != EAGAIN && errno != EINTR) {
-            DPRINTF("error flushing output: %d\n", errno);
-            return -1;
-        }
-        if (rc > 0)
-            cur += rc;
-
-        rc = write(fd, ob->buf + cur, ob->pos - cur);
-    }
-
-    ob->pos = 0;
-
-    return 0;
-}
-
-/* if there's no room in the buffer, flush it and try again. */
-static inline int outbuf_hardwrite(xc_interface *xch,
-                                   struct outbuf* ob, int fd, void* buf,
-                                   size_t len)
-{
-    if ( !len )
-        return 0;
-
-    if ( !outbuf_write(xch, ob, buf, len) )
-        return 0;
-
-    if ( outbuf_flush(xch, ob, fd) < 0 )
-        return -1;
-
-    return outbuf_write(xch, ob, buf, len);
-}
-
-/* start buffering output once we've reached checkpoint mode. */
-static inline int write_buffer(xc_interface *xch,
-                               int dobuf, struct outbuf* ob, int fd, void* buf,
-                               size_t len)
-{
-    if ( dobuf )
-        return outbuf_hardwrite(xch, ob, fd, buf, len);
-    else
-        return write_exact(fd, buf, len);
-}
-
-/* like write_buffer for noncached, which returns number of bytes written */
-static inline int write_uncached(xc_interface *xch,
-                                   int dobuf, struct outbuf* ob, int fd,
-                                   void* buf, size_t len)
-{
-    if ( dobuf )
-        return outbuf_hardwrite(xch, ob, fd, buf, len) ? -1 : len;
-    else
-        return noncached_write(xch, ob, fd, buf, len);
-}
-
-static int write_compressed(xc_interface *xch, comp_ctx *compress_ctx,
-                            int dobuf, struct outbuf* ob, int fd)
-{
-    int rc = 0;
-    int header = sizeof(int) + sizeof(unsigned long);
-    int marker = XC_SAVE_ID_COMPRESSED_DATA;
-    unsigned long compbuf_len = 0;
-
-    for(;;)
-    {
-        /* check for available space (atleast 8k) */
-        if ((ob->pos + header + XC_PAGE_SIZE * 2) > ob->size)
-        {
-            if (outbuf_flush(xch, ob, fd) < 0)
-            {
-                ERROR("Error when flushing outbuf intermediate");
-                return -1;
-            }
-        }
-
-        rc = xc_compression_compress_pages(xch, compress_ctx,
-                                           ob->buf + ob->pos + header,
-                                           ob->size - ob->pos - header,
-                                           &compbuf_len);
-        if (!rc)
-            break;
-
-        if (outbuf_hardwrite(xch, ob, fd, &marker, sizeof(marker)) < 0)
-        {
-            PERROR("Error when writing marker (errno %d)", errno);
-            return -1;
-        }
-
-        if (outbuf_hardwrite(xch, ob, fd, &compbuf_len, sizeof(compbuf_len)) < 0)
-        {
-            PERROR("Error when writing compbuf_len (errno %d)", errno);
-            return -1;
-        }
-
-        ob->pos += (size_t) compbuf_len;
-        if (!dobuf && outbuf_flush(xch, ob, fd) < 0)
-        {
-            ERROR("Error when writing compressed chunk");
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-struct time_stats {
-    struct timeval wall;
-    long long d0_cpu, d1_cpu;
-};
-
-static int print_stats(xc_interface *xch, uint32_t domid, int pages_sent,
-                       struct time_stats *last,
-                       xc_shadow_op_stats_t *stats, int print)
-{
-    struct time_stats now;
-
-    gettimeofday(&now.wall, NULL);
-
-    now.d0_cpu = xc_domain_get_cpu_usage(xch, 0, /* FIXME */ 0)/1000;
-    now.d1_cpu = xc_domain_get_cpu_usage(xch, domid, /* FIXME */ 0)/1000;
-
-    if ( (now.d0_cpu == -1) || (now.d1_cpu == -1) )
-        DPRINTF("ARRHHH!!\n");
-
-    if ( print )
-    {
-        long long wall_delta;
-        long long d0_cpu_delta;
-        long long d1_cpu_delta;
-
-        wall_delta = tv_delta(&now.wall,&last->wall)/1000;
-        if ( wall_delta == 0 )
-            wall_delta = 1;
-
-        d0_cpu_delta = (now.d0_cpu - last->d0_cpu)/1000;
-        d1_cpu_delta = (now.d1_cpu - last->d1_cpu)/1000;
-
-        DPRINTF("delta %lldms, dom0 %d%%, target %d%%, sent %dMb/s, "
-                "dirtied %dMb/s %" PRId32 " pages\n",
-                wall_delta,
-                (int)((d0_cpu_delta*100)/wall_delta),
-                (int)((d1_cpu_delta*100)/wall_delta),
-                (int)((pages_sent*PAGE_SIZE)/(wall_delta*(1000/8))),
-                (int)((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8))),
-                stats->dirty_count);
-    }
-
-    *last = now;
-
-    return 0;
-}
-
-
-static int analysis_phase(xc_interface *xch, uint32_t domid, struct save_ctx *ctx,
-                          xc_hypercall_buffer_t *arr, int runs)
-{
-    long long start, now;
-    xc_shadow_op_stats_t stats;
-    int j;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-
-    start = llgettimeofday();
-
-    for ( j = 0; j < runs; j++ )
-    {
-        int i;
-
-        xc_shadow_control(xch, domid, XEN_DOMCTL_SHADOW_OP_CLEAN,
-                          arr, dinfo->p2m_size, NULL, 0, NULL);
-        DPRINTF("#Flush\n");
-        for ( i = 0; i < 40; i++ )
-        {
-            usleep(50000);
-            now = llgettimeofday();
-            xc_shadow_control(xch, domid, XEN_DOMCTL_SHADOW_OP_PEEK,
-                              NULL, 0, NULL, 0, &stats);
-            DPRINTF("now= %lld faults= %"PRId32" dirty= %"PRId32"\n",
-                    ((now-start)+500)/1000,
-                    stats.fault_count, stats.dirty_count);
-        }
-    }
-
-    return -1;
-}
-
-static int suspend_and_state(int (*suspend)(void*), void* data,
-                             xc_interface *xch, int io_fd, int dom,
-                             xc_dominfo_t *info)
-{
-    if ( !(*suspend)(data) )
-    {
-        ERROR("Suspend request failed");
-        return -1;
-    }
-
-    if ( (xc_domain_getinfo(xch, dom, 1, info) != 1) ||
-         !info->shutdown || (info->shutdown_reason != SHUTDOWN_suspend) )
-    {
-        ERROR("Domain not in suspended state");
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
-** Map the top-level page of MFNs from the guest. The guest might not have
-** finished resuming from a previous restore operation, so we wait a while for
-** it to update the MFN to a reasonable value.
-*/
-static void *map_frame_list_list(xc_interface *xch, uint32_t dom,
-                                 struct save_ctx *ctx,
-                                 shared_info_any_t *shinfo)
-{
-    int count = 100;
-    void *p;
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    uint64_t fll = GET_FIELD(shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width);
-
-    while ( count-- && (fll == 0) )
-    {
-        usleep(10000);
-        fll = GET_FIELD(shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width);
-    }
-
-    if ( fll == 0 )
-    {
-        ERROR("Timed out waiting for frame list updated.");
-        return NULL;
-    }
-
-    p = xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ, fll);
-    if ( p == NULL )
-        PERROR("Couldn't map p2m_frame_list_list (errno %d)", errno);
-
-    return p;
-}
-
-/*
-** During transfer (or in the state file), all page-table pages must be
-** converted into a 'canonical' form where references to actual mfns
-** are replaced with references to the corresponding pfns.
-**
-** This function performs the appropriate conversion, taking into account
-** which entries do not require canonicalization (in particular, those
-** entries which map the virtual address reserved for the hypervisor).
-*/
-static int canonicalize_pagetable(struct save_ctx *ctx,
-                           unsigned long type, unsigned long pfn,
-                           const void *spage, void *dpage)
-{
-    struct domain_info_context *dinfo = &ctx->dinfo;
-    int i, pte_last, xen_start, xen_end, race = 0; 
-    uint64_t pte;
-
-    /*
-    ** We need to determine which entries in this page table hold
-    ** reserved hypervisor mappings. This depends on the current
-    ** page table type as well as the number of paging levels.
-    */
-    xen_start = xen_end = pte_last = PAGE_SIZE / 8;
-
-    if ( (ctx->pt_levels == 3) && (type == XEN_DOMCTL_PFINFO_L3TAB) )
-        xen_start = L3_PAGETABLE_ENTRIES_PAE;
-
-    /*
-    ** In PAE only the L2 mapping the top 1GB contains Xen mappings.
-    ** We can spot this by looking for the guest's mappingof the m2p.
-    ** Guests must ensure that this check will fail for other L2s.
-    */
-    if ( (ctx->pt_levels == 3) && (type == XEN_DOMCTL_PFINFO_L2TAB) )
-    {
-        int hstart;
-        uint64_t he;
-
-        hstart = (ctx->hvirt_start >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff;
-        he = ((const uint64_t *) spage)[hstart];
-
-        if ( ((he >> PAGE_SHIFT) & MFN_MASK_X86) == ctx->m2p_mfn0 )
-        {
-            /* hvirt starts with xen stuff... */
-            xen_start = hstart;
-        }
-        else if ( ctx->hvirt_start != 0xf5800000 )
-        {
-            /* old L2s from before hole was shrunk... */
-            hstart = (0xf5800000 >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff;
-            he = ((const uint64_t *) spage)[hstart];
-            if ( ((he >> PAGE_SHIFT) & MFN_MASK_X86) == ctx->m2p_mfn0 )
-                xen_start = hstart;
-        }
-    }
-
-    if ( (ctx->pt_levels == 4) && (type == XEN_DOMCTL_PFINFO_L4TAB) )
-    {
-        /*
-        ** XXX SMH: should compute these from hvirt_start (which we have)
-        ** and hvirt_end (which we don't)
-        */
-        xen_start = 256;
-        xen_end   = 272;
-    }
-
-    /* Now iterate through the page table, canonicalizing each PTE */
-    for (i = 0; i < pte_last; i++ )
-    {
-        unsigned long pfn, mfn;
-
-        pte = ((const uint64_t*)spage)[i];
-
-        if ( (i >= xen_start) && (i < xen_end) )
-            pte = 0;
-
-        if ( pte & _PAGE_PRESENT )
-        {
-            mfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-            if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
-            {
-                /* This will happen if the type info is stale which
-                   is quite feasible under live migration */
-                pfn  = 0;  /* zap it - we'll retransmit this page later */
-                /* XXX: We can't spot Xen mappings in compat-mode L2es 
-                 * from 64-bit tools, but the only thing in them is the
-                 * compat m2p, so we quietly zap them.  This doesn't
-                 * count as a race, so don't report it. */
-                if ( !(type == XEN_DOMCTL_PFINFO_L2TAB 
-                       && sizeof (unsigned long) > dinfo->guest_width) )
-                     race = 1;  /* inform the caller; fatal if !live */ 
-            }
-            else
-                pfn = mfn_to_pfn(mfn);
-
-            pte &= ~MADDR_MASK_X86;
-            pte |= (uint64_t)pfn << PAGE_SHIFT;
-
-            /*
-             * PAE guest L3Es can contain these flags when running on
-             * a 64bit hypervisor. We zap these here to avoid any
-             * surprise at restore time...
-             */
-            if ( (ctx->pt_levels == 3) &&
-                 (type == XEN_DOMCTL_PFINFO_L3TAB) &&
-                 (pte & (_PAGE_USER|_PAGE_RW|_PAGE_ACCESSED)) )

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:45:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45: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 1ZLAcU-00073O-Ld; Fri, 31 Jul 2015 13:45: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 1ZLAcT-000735-OL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:05 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	97/3D-09570-1EB7BB55; Fri, 31 Jul 2015 13:45:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350303!29870395!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 7676 invoked from network); 31 Jul 2015 13:45:04 -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;
	31 Jul 2015 13:45:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcR-0004d7-0h
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcQ-0007Qi-Pg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:02 +0000
Date: Fri, 31 Jul 2015 13:45:02 +0000
Message-Id: <E1ZLAcQ-0007Qi-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Remove the toolstack_{save, restore} callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2591383a503b289d9f1594e2f34cf1b49b0356f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:55 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks
    
    Update the libxc spec to indicate more sternly that TOOLSTACK records
    should no longer be used.
    
    Also, trim further toolstack infrastructure which should have gone in
    c/s 39bf4e9 "tools/libxl: Drop all knowledge of toolstack callbacks"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/specs/libxc-migration-stream.pandoc |   14 ++++++--------
 tools/libxc/include/xenguest.h           |   12 ------------
 tools/libxl/libxl_internal.h             |    1 -
 tools/libxl/libxl_save_callout.c         |    2 --
 4 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc
index 68fa513..9d8f17b 100644
--- a/docs/specs/libxc-migration-stream.pandoc
+++ b/docs/specs/libxc-migration-stream.pandoc
@@ -219,7 +219,7 @@ type         0x00000000: END
 
              0x0000000A: HVM_PARAMS
 
-             0x0000000B: TOOLSTACK
+             0x0000000B: TOOLSTACK (deprecated)
 
              0x0000000C: X86_PV_VCPU_MSRS
 
@@ -540,17 +540,15 @@ param value      Parameter value.
 
 \clearpage
 
-TOOLSTACK
----------
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes during
+>  development.  It is should not be used.*
 
 An opaque blob provided by and supplied to the higher layers of the
 toolstack (e.g., libxl) during save and restore.
 
-> This is only temporary -- the intention is the toolstack takes care
-> of this itself.  This record is only present for early development
-> purposes and will be removed before submissions, along with changes
-> to libxl which cause libxl to handle this data itself.
-
      0     1     2     3     4     5     6     7 octet
     +------------------------+------------------------+
     | data                                            |
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index e95af54..231ec6e 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -67,14 +67,6 @@ struct save_callbacks {
     /* Enable qemu-dm logging dirty pages to xen */
     int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* HVM only */
 
-    /* Save toolstack specific data
-     * @param buf the buffer with the data to be saved
-     * @param len the length of the buffer
-     * The callee allocates the buffer, the caller frees it (buffer must
-     * be free'able).
-     */
-    int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void *data);
-
     /* to be provided as the last argument to each callback function */
     void* data;
 };
@@ -98,10 +90,6 @@ int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_ite
 
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
-    /* callback to restore toolstack specific data */
-    int (*toolstack_restore)(uint32_t domid, const uint8_t *buf,
-            uint32_t size, void* data);
-
     /* A checkpoint record has been found in the stream.
      * returns: */
 #define XGR_CHECKPOINT_ERROR    0 /* Terminate processing */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f2466dc..ea6c73f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2761,7 +2761,6 @@ typedef struct libxl__save_helper_state {
     libxl__ev_fd readable;
     libxl__ev_child child;
     const char *stdin_what, *stdout_what;
-    FILE *toolstack_data_file;
 
     libxl__egc *egc; /* valid only for duration of each event callback;
                       * is here in this struct for the benefit of the
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index f2ce868..3af99af 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -70,7 +70,6 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
     shs->completion_callback = libxl__xc_domain_restore_done;
     shs->caller_state = dcs;
     shs->need_results = 1;
-    shs->toolstack_data_file = 0;
 
     run_helper(egc, shs, "--restore-domain", restore_fd, 0, 0,
                argnums, ARRAY_SIZE(argnums));
@@ -333,7 +332,6 @@ static void helper_done(libxl__egc *egc, libxl__save_helper_state *shs)
     libxl__carefd_close(shs->pipes[0]);  shs->pipes[0] = 0;
     libxl__carefd_close(shs->pipes[1]);  shs->pipes[1] = 0;
     assert(!libxl__save_helper_inuse(shs));
-    if (shs->toolstack_data_file) fclose(shs->toolstack_data_file);
 
     shs->egc = egc;
     shs->completion_callback(egc, shs->caller_state,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45: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 1ZLAcU-00073O-Ld; Fri, 31 Jul 2015 13:45: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 1ZLAcT-000735-OL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:05 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	97/3D-09570-1EB7BB55; Fri, 31 Jul 2015 13:45:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350303!29870395!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 7676 invoked from network); 31 Jul 2015 13:45:04 -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;
	31 Jul 2015 13:45:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcR-0004d7-0h
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcQ-0007Qi-Pg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:02 +0000
Date: Fri, 31 Jul 2015 13:45:02 +0000
Message-Id: <E1ZLAcQ-0007Qi-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Remove the toolstack_{save, restore} callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2591383a503b289d9f1594e2f34cf1b49b0356f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:55 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks
    
    Update the libxc spec to indicate more sternly that TOOLSTACK records
    should no longer be used.
    
    Also, trim further toolstack infrastructure which should have gone in
    c/s 39bf4e9 "tools/libxl: Drop all knowledge of toolstack callbacks"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/specs/libxc-migration-stream.pandoc |   14 ++++++--------
 tools/libxc/include/xenguest.h           |   12 ------------
 tools/libxl/libxl_internal.h             |    1 -
 tools/libxl/libxl_save_callout.c         |    2 --
 4 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc
index 68fa513..9d8f17b 100644
--- a/docs/specs/libxc-migration-stream.pandoc
+++ b/docs/specs/libxc-migration-stream.pandoc
@@ -219,7 +219,7 @@ type         0x00000000: END
 
              0x0000000A: HVM_PARAMS
 
-             0x0000000B: TOOLSTACK
+             0x0000000B: TOOLSTACK (deprecated)
 
              0x0000000C: X86_PV_VCPU_MSRS
 
@@ -540,17 +540,15 @@ param value      Parameter value.
 
 \clearpage
 
-TOOLSTACK
----------
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes during
+>  development.  It is should not be used.*
 
 An opaque blob provided by and supplied to the higher layers of the
 toolstack (e.g., libxl) during save and restore.
 
-> This is only temporary -- the intention is the toolstack takes care
-> of this itself.  This record is only present for early development
-> purposes and will be removed before submissions, along with changes
-> to libxl which cause libxl to handle this data itself.
-
      0     1     2     3     4     5     6     7 octet
     +------------------------+------------------------+
     | data                                            |
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index e95af54..231ec6e 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -67,14 +67,6 @@ struct save_callbacks {
     /* Enable qemu-dm logging dirty pages to xen */
     int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* HVM only */
 
-    /* Save toolstack specific data
-     * @param buf the buffer with the data to be saved
-     * @param len the length of the buffer
-     * The callee allocates the buffer, the caller frees it (buffer must
-     * be free'able).
-     */
-    int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void *data);
-
     /* to be provided as the last argument to each callback function */
     void* data;
 };
@@ -98,10 +90,6 @@ int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_ite
 
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
-    /* callback to restore toolstack specific data */
-    int (*toolstack_restore)(uint32_t domid, const uint8_t *buf,
-            uint32_t size, void* data);
-
     /* A checkpoint record has been found in the stream.
      * returns: */
 #define XGR_CHECKPOINT_ERROR    0 /* Terminate processing */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f2466dc..ea6c73f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2761,7 +2761,6 @@ typedef struct libxl__save_helper_state {
     libxl__ev_fd readable;
     libxl__ev_child child;
     const char *stdin_what, *stdout_what;
-    FILE *toolstack_data_file;
 
     libxl__egc *egc; /* valid only for duration of each event callback;
                       * is here in this struct for the benefit of the
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index f2ce868..3af99af 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -70,7 +70,6 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
     shs->completion_callback = libxl__xc_domain_restore_done;
     shs->caller_state = dcs;
     shs->need_results = 1;
-    shs->toolstack_data_file = 0;
 
     run_helper(egc, shs, "--restore-domain", restore_fd, 0, 0,
                argnums, ARRAY_SIZE(argnums));
@@ -333,7 +332,6 @@ static void helper_done(libxl__egc *egc, libxl__save_helper_state *shs)
     libxl__carefd_close(shs->pipes[0]);  shs->pipes[0] = 0;
     libxl__carefd_close(shs->pipes[1]);  shs->pipes[1] = 0;
     assert(!libxl__save_helper_inuse(shs));
-    if (shs->toolstack_data_file) fclose(shs->toolstack_data_file);
 
     shs->egc = egc;
     shs->completion_callback(egc, shs->caller_state,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAce-00074y-O8; Fri, 31 Jul 2015 13:45: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 1ZLAcd-00074g-K1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:15 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	85/15-06021-AEB7BB55; Fri, 31 Jul 2015 13:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438350313!31107152!1
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 31183 invoked from network); 31 Jul 2015 13:45:14 -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;
	31 Jul 2015 13:45:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcb-0004dM-8W
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcb-0007RH-5o
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:13 +0000
Date: Fri, 31 Jul 2015 13:45:13 +0000
Message-Id: <E1ZLAcb-0007RH-5o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Remove XC_DEVICE_MODEL_RESTORE_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 f6ddbfae1c95a8bbc3e52c431afee665b864cfda
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Remove XC_DEVICE_MODEL_RESTORE_FILE
    
    All handling of device model files is now at the libxl level.  Remove
    XC_DEVICE_MODEL_RESTORE_FILE and introduce LIBXL_DEVICE_MODEL_RESTORE_FILE in
    its place.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h  |    8 --------
 tools/libxl/libxl.c             |    2 +-
 tools/libxl/libxl_create.c      |    2 +-
 tools/libxl/libxl_internal.h    |    1 +
 tools/libxl/libxl_stream_read.c |    2 +-
 5 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 231ec6e..9772576 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -135,14 +135,6 @@ int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
                        unsigned int hvm, unsigned int pae, int superpages,
                        int checkpointed_stream,
                        struct restore_callbacks *callbacks);
-/**
- * xc_domain_restore writes a file to disk that contains the device
- * model saved state.
- * The pathname of this file is XC_DEVICE_MODEL_RESTORE_FILE; The domid
- * of the new domain is automatically appended to the filename,
- * separated by a ".".
- */
-#define XC_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume"
 
 /**
  * This function will create a domain for a paravirtualized Linux
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ff0d616..614ca33 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1671,7 +1671,7 @@ static void devices_destroy_cb(libxl__egc *egc,
     rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
     if (rc < 0) goto out;
     rc = libxl__remove_file(gc,
-             GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
+             GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", domid));
     if (rc < 0) goto out;
 
     rc = libxl__ev_child_fork(gc, &dis->destroyer, domain_destroy_domid_cb);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 0294844..4f2f50b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1102,7 +1102,7 @@ static void domcreate_stream_done(libxl__egc *egc,
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         state->saved_state = GCSPRINTF(
-                       XC_DEVICE_MODEL_RESTORE_FILE".%d", domid);
+                       LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", domid);
     }
 
 out:
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index ea6c73f..89563a4 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -90,6 +90,7 @@
 /* QEMU may be slow to load and start due to a bug in Linux where the I/O
  * subsystem sometime produce high latency under load. */
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
+#define LIBXL_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume" /* .$domid */
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 32a3551..56637e2 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -593,7 +593,7 @@ static void write_emulator_blob(libxl__egc *egc,
     }
     emu_hdr = rec->body;
 
-    sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
+    sprintf(path, LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
 
     assert(stream->emu_carefd == NULL);
     libxl__carefd_begin();
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAce-00074y-O8; Fri, 31 Jul 2015 13:45: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 1ZLAcd-00074g-K1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:15 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	85/15-06021-AEB7BB55; Fri, 31 Jul 2015 13:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1438350313!31107152!1
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 31183 invoked from network); 31 Jul 2015 13:45:14 -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;
	31 Jul 2015 13:45:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcb-0004dM-8W
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcb-0007RH-5o
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:13 +0000
Date: Fri, 31 Jul 2015 13:45:13 +0000
Message-Id: <E1ZLAcb-0007RH-5o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Remove XC_DEVICE_MODEL_RESTORE_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 f6ddbfae1c95a8bbc3e52c431afee665b864cfda
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Remove XC_DEVICE_MODEL_RESTORE_FILE
    
    All handling of device model files is now at the libxl level.  Remove
    XC_DEVICE_MODEL_RESTORE_FILE and introduce LIBXL_DEVICE_MODEL_RESTORE_FILE in
    its place.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h  |    8 --------
 tools/libxl/libxl.c             |    2 +-
 tools/libxl/libxl_create.c      |    2 +-
 tools/libxl/libxl_internal.h    |    1 +
 tools/libxl/libxl_stream_read.c |    2 +-
 5 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 231ec6e..9772576 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -135,14 +135,6 @@ int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
                        unsigned int hvm, unsigned int pae, int superpages,
                        int checkpointed_stream,
                        struct restore_callbacks *callbacks);
-/**
- * xc_domain_restore writes a file to disk that contains the device
- * model saved state.
- * The pathname of this file is XC_DEVICE_MODEL_RESTORE_FILE; The domid
- * of the new domain is automatically appended to the filename,
- * separated by a ".".
- */
-#define XC_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume"
 
 /**
  * This function will create a domain for a paravirtualized Linux
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ff0d616..614ca33 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1671,7 +1671,7 @@ static void devices_destroy_cb(libxl__egc *egc,
     rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
     if (rc < 0) goto out;
     rc = libxl__remove_file(gc,
-             GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
+             GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", domid));
     if (rc < 0) goto out;
 
     rc = libxl__ev_child_fork(gc, &dis->destroyer, domain_destroy_domid_cb);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 0294844..4f2f50b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1102,7 +1102,7 @@ static void domcreate_stream_done(libxl__egc *egc,
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         state->saved_state = GCSPRINTF(
-                       XC_DEVICE_MODEL_RESTORE_FILE".%d", domid);
+                       LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", domid);
     }
 
 out:
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index ea6c73f..89563a4 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -90,6 +90,7 @@
 /* QEMU may be slow to load and start due to a bug in Linux where the I/O
  * subsystem sometime produce high latency under load. */
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
+#define LIBXL_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume" /* .$domid */
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 32a3551..56637e2 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -593,7 +593,7 @@ static void write_emulator_blob(libxl__egc *egc,
     }
     emu_hdr = rec->body;
 
-    sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
+    sprintf(path, LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
 
     assert(stream->emu_carefd == NULL);
     libxl__carefd_begin();
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAcp-00076m-S9; Fri, 31 Jul 2015 13: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 1ZLAco-00076P-53
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:26 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	0D/AC-05269-5FB7BB55; Fri, 31 Jul 2015 13:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350323!31174157!1
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 8936 invoked from network); 31 Jul 2015 13:45:24 -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;
	31 Jul 2015 13:45:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcl-0004dU-I8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcl-0007Rl-D5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:23 +0000
Date: Fri, 31 Jul 2015 13:45:23 +0000
Message-Id: <E1ZLAcl-0007Rl-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Drop '2' suffixes from xc_domain_{save, restore}2() 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 ca195855e47c1e9ccd4c975c1e45b13b2ff02d76
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:57 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Drop '2' suffixes from xc_domain_{save, restore}2() functions
    
    As there is now only the one implementation.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h  |   14 --------------
 tools/libxc/xc_nomigrate.c      |   20 --------------------
 tools/libxc/xc_sr_restore.c     |   14 +++++++-------
 tools/libxc/xc_sr_save.c        |    6 +++---
 tools/libxl/libxl_save_helper.c |    4 ++--
 5 files changed, 12 insertions(+), 46 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 9772576..f837bde 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -83,11 +83,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                    uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
                    struct save_callbacks* callbacks, int hvm);
 
-/* Domain Save v2 */
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
-                    uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm);
-
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
     /* A checkpoint record has been found in the stream.
@@ -127,15 +122,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       int checkpointed_stream,
                       struct restore_callbacks *callbacks);
 
-/* Domain Restore v2 */
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_mfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks);
-
 /**
  * This function will create a domain for a paravirtualized Linux
  * using file names pointing to kernel and ramdisk
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 426aee6..76978a0 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -29,14 +29,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     return -1;
 }
 
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
-                    uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       domid_t store_domid, unsigned int console_evtchn,
@@ -49,18 +41,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     return -1;
 }
 
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_mfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index bf1ee15..ebc8f2f 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -714,13 +714,13 @@ static int restore(struct xc_sr_context *ctx)
     return rc;
 }
 
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_gfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks)
+int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
+                      unsigned int store_evtchn, unsigned long *store_mfn,
+                      domid_t store_domid, unsigned int console_evtchn,
+                      unsigned long *console_gfn, domid_t console_domid,
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int checkpointed_stream,
+                      struct restore_callbacks *callbacks)
 {
     struct xc_sr_context ctx =
         {
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 1b6be2a..770bc19 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -819,9 +819,9 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
     return rc;
 };
 
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom,
-                    uint32_t max_iters, uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm)
+int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
+                   uint32_t max_iters, uint32_t max_factor, uint32_t flags,
+                   struct save_callbacks* callbacks, int hvm)
 {
     xen_pfn_t nr_pfns;
     struct xc_sr_context ctx =
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 1622bb7..57ae978 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
         startup("save");
         setup_signals(save_signal_handler);
 
-        r = xc_domain_save2(xch, io_fd, dom, max_iters, max_factor, flags,
+        r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags,
                            &helper_save_callbacks, hvm);
         complete(r);
 
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
         startup("restore");
         setup_signals(SIG_DFL);
 
-        r = xc_domain_restore2(xch, io_fd, dom, store_evtchn, &store_mfn,
+        r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
                               console_domid, hvm, pae, superpages,
                               checkpointed,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAcp-00076m-S9; Fri, 31 Jul 2015 13: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 1ZLAco-00076P-53
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:26 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	0D/AC-05269-5FB7BB55; Fri, 31 Jul 2015 13:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350323!31174157!1
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 8936 invoked from network); 31 Jul 2015 13:45:24 -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;
	31 Jul 2015 13:45:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcl-0004dU-I8
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcl-0007Rl-D5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:23 +0000
Date: Fri, 31 Jul 2015 13:45:23 +0000
Message-Id: <E1ZLAcl-0007Rl-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Drop '2' suffixes from xc_domain_{save, restore}2() 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 ca195855e47c1e9ccd4c975c1e45b13b2ff02d76
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:57 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    tools/libx{l, c}: Drop '2' suffixes from xc_domain_{save, restore}2() functions
    
    As there is now only the one implementation.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h  |   14 --------------
 tools/libxc/xc_nomigrate.c      |   20 --------------------
 tools/libxc/xc_sr_restore.c     |   14 +++++++-------
 tools/libxc/xc_sr_save.c        |    6 +++---
 tools/libxl/libxl_save_helper.c |    4 ++--
 5 files changed, 12 insertions(+), 46 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 9772576..f837bde 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -83,11 +83,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                    uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
                    struct save_callbacks* callbacks, int hvm);
 
-/* Domain Save v2 */
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
-                    uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm);
-
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
     /* A checkpoint record has been found in the stream.
@@ -127,15 +122,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       int checkpointed_stream,
                       struct restore_callbacks *callbacks);
 
-/* Domain Restore v2 */
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_mfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks);
-
 /**
  * This function will create a domain for a paravirtualized Linux
  * using file names pointing to kernel and ramdisk
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 426aee6..76978a0 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -29,14 +29,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     return -1;
 }
 
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
-                    uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       domid_t store_domid, unsigned int console_evtchn,
@@ -49,18 +41,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     return -1;
 }
 
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_mfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index bf1ee15..ebc8f2f 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -714,13 +714,13 @@ static int restore(struct xc_sr_context *ctx)
     return rc;
 }
 
-int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
-                       unsigned int store_evtchn, unsigned long *store_mfn,
-                       domid_t store_domid, unsigned int console_evtchn,
-                       unsigned long *console_gfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks)
+int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
+                      unsigned int store_evtchn, unsigned long *store_mfn,
+                      domid_t store_domid, unsigned int console_evtchn,
+                      unsigned long *console_gfn, domid_t console_domid,
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int checkpointed_stream,
+                      struct restore_callbacks *callbacks)
 {
     struct xc_sr_context ctx =
         {
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 1b6be2a..770bc19 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -819,9 +819,9 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
     return rc;
 };
 
-int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom,
-                    uint32_t max_iters, uint32_t max_factor, uint32_t flags,
-                    struct save_callbacks* callbacks, int hvm)
+int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
+                   uint32_t max_iters, uint32_t max_factor, uint32_t flags,
+                   struct save_callbacks* callbacks, int hvm)
 {
     xen_pfn_t nr_pfns;
     struct xc_sr_context ctx =
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 1622bb7..57ae978 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
         startup("save");
         setup_signals(save_signal_handler);
 
-        r = xc_domain_save2(xch, io_fd, dom, max_iters, max_factor, flags,
+        r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags,
                            &helper_save_callbacks, hvm);
         complete(r);
 
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
         startup("restore");
         setup_signals(SIG_DFL);
 
-        r = xc_domain_restore2(xch, io_fd, dom, store_evtchn, &store_mfn,
+        r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
                               console_domid, hvm, pae, superpages,
                               checkpointed,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAd2-00078Z-VI; Fri, 31 Jul 2015 13:45: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 1ZLAd2-00078Q-3Z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:40 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	AA/06-12946-30C7BB55; Fri, 31 Jul 2015 13:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438350334!31068514!1
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 25305 invoked from network); 31 Jul 2015 13:45:35 -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;
	31 Jul 2015 13:45:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcw-0004dc-Ik
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcv-0007Sg-Lo
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:33 +0000
Date: Fri, 31 Jul 2015 13:45:33 +0000
Message-Id: <E1ZLAcv-0007Sg-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Migration v2 is now no longer
	draft
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5850b0317d20e6139d74e45c4fd87ae318ce7ee1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:58 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    docs: Migration v2 is now no longer draft
    
    Add further instructions to the libxc "Future Extensions" section, and
    provide such a section for libxl.
    
    In addition, drop the "In experimental __func__" IPRINTF()s from the
    libxc implementations.
    
    Finally, a correction to libxl's "Not Yet Included" section which
    should have been amended in c/s 7eaec00 when libxl Remus support was
    introduced into the protocol.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/specs/libxc-migration-stream.pandoc |    5 ++++-
 docs/specs/libxl-migration-stream.pandoc |   19 ++++++++++++++++---
 tools/libxc/xc_sr_restore.c              |    1 -
 tools/libxc/xc_sr_save.c                 |    1 -
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc
index 9d8f17b..8cd678f 100644
--- a/docs/specs/libxc-migration-stream.pandoc
+++ b/docs/specs/libxc-migration-stream.pandoc
@@ -1,7 +1,7 @@
 % LibXenCtrl Domain Image Format
 % David Vrabel <<david.vrabel@citrix.com>>
   Andrew Cooper <<andrew.cooper3@citrix.com>>
-% Draft G
+% Revision 1
 
 Introduction
 ============
@@ -679,6 +679,9 @@ introduced in Xen 3.0.
 Future Extensions
 =================
 
+All changes to this specification should bump the revision number in
+the title block.
+
 All changes to the image or domain headers require the image version
 to be increased.
 
diff --git a/docs/specs/libxl-migration-stream.pandoc b/docs/specs/libxl-migration-stream.pandoc
index c24a434..cdec168 100644
--- a/docs/specs/libxl-migration-stream.pandoc
+++ b/docs/specs/libxl-migration-stream.pandoc
@@ -1,6 +1,6 @@
 % LibXenLight Domain Image Format
 % Andrew Cooper <<andrew.cooper3@citrix.com>>
-% Draft B
+% Revision 1
 
 Introduction
 ============
@@ -41,8 +41,6 @@ Not Yet Included
 The following features are not yet fully specified and will be
 included in a future draft.
 
-* Remus
-
 * ARM
 
 
@@ -215,3 +213,18 @@ A checkpoint end record marks the end of a checkpoint in the image.
     +-------------------------------------------------+
 
 The end record contains no fields; its body_length is 0.
+
+
+Future Extensions
+=================
+
+All changes to this specification should bump the revision number in
+the title block.
+
+All changes to the header require the header version to be increased.
+
+The format may be extended by adding additional record types.
+
+Extending an existing record type must be done by adding a new record
+type.  This allows old images with the old record to still be
+restored.
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index ebc8f2f..df885b6 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -740,7 +740,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     if ( checkpointed_stream )
         assert(callbacks->checkpoint);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, hvm %u, pae %u, superpages %d"
             ", checkpointed_stream %d", io_fd, dom, hvm, pae,
             superpages, checkpointed_stream);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 770bc19..cd2be47 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -851,7 +851,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
     if ( ctx.save.checkpointed )
         assert(callbacks->checkpoint && callbacks->postcopy);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, max_iters %u, max_factor %u, flags %u, hvm %d",
             io_fd, dom, max_iters, max_factor, flags, hvm);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAd2-00078Z-VI; Fri, 31 Jul 2015 13:45: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 1ZLAd2-00078Q-3Z
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:40 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	AA/06-12946-30C7BB55; Fri, 31 Jul 2015 13:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1438350334!31068514!1
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 25305 invoked from network); 31 Jul 2015 13:45:35 -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;
	31 Jul 2015 13:45:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcw-0004dc-Ik
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAcv-0007Sg-Lo
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:33 +0000
Date: Fri, 31 Jul 2015 13:45:33 +0000
Message-Id: <E1ZLAcv-0007Sg-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Migration v2 is now no longer
	draft
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5850b0317d20e6139d74e45c4fd87ae318ce7ee1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:58 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:52 2015 +0100

    docs: Migration v2 is now no longer draft
    
    Add further instructions to the libxc "Future Extensions" section, and
    provide such a section for libxl.
    
    In addition, drop the "In experimental __func__" IPRINTF()s from the
    libxc implementations.
    
    Finally, a correction to libxl's "Not Yet Included" section which
    should have been amended in c/s 7eaec00 when libxl Remus support was
    introduced into the protocol.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/specs/libxc-migration-stream.pandoc |    5 ++++-
 docs/specs/libxl-migration-stream.pandoc |   19 ++++++++++++++++---
 tools/libxc/xc_sr_restore.c              |    1 -
 tools/libxc/xc_sr_save.c                 |    1 -
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc
index 9d8f17b..8cd678f 100644
--- a/docs/specs/libxc-migration-stream.pandoc
+++ b/docs/specs/libxc-migration-stream.pandoc
@@ -1,7 +1,7 @@
 % LibXenCtrl Domain Image Format
 % David Vrabel <<david.vrabel@citrix.com>>
   Andrew Cooper <<andrew.cooper3@citrix.com>>
-% Draft G
+% Revision 1
 
 Introduction
 ============
@@ -679,6 +679,9 @@ introduced in Xen 3.0.
 Future Extensions
 =================
 
+All changes to this specification should bump the revision number in
+the title block.
+
 All changes to the image or domain headers require the image version
 to be increased.
 
diff --git a/docs/specs/libxl-migration-stream.pandoc b/docs/specs/libxl-migration-stream.pandoc
index c24a434..cdec168 100644
--- a/docs/specs/libxl-migration-stream.pandoc
+++ b/docs/specs/libxl-migration-stream.pandoc
@@ -1,6 +1,6 @@
 % LibXenLight Domain Image Format
 % Andrew Cooper <<andrew.cooper3@citrix.com>>
-% Draft B
+% Revision 1
 
 Introduction
 ============
@@ -41,8 +41,6 @@ Not Yet Included
 The following features are not yet fully specified and will be
 included in a future draft.
 
-* Remus
-
 * ARM
 
 
@@ -215,3 +213,18 @@ A checkpoint end record marks the end of a checkpoint in the image.
     +-------------------------------------------------+
 
 The end record contains no fields; its body_length is 0.
+
+
+Future Extensions
+=================
+
+All changes to this specification should bump the revision number in
+the title block.
+
+All changes to the header require the header version to be increased.
+
+The format may be extended by adding additional record types.
+
+Extending an existing record type must be done by adding a new record
+type.  This allows old images with the old record to still be
+restored.
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index ebc8f2f..df885b6 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -740,7 +740,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     if ( checkpointed_stream )
         assert(callbacks->checkpoint);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, hvm %u, pae %u, superpages %d"
             ", checkpointed_stream %d", io_fd, dom, hvm, pae,
             superpages, checkpointed_stream);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 770bc19..cd2be47 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -851,7 +851,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
     if ( ctx.save.checkpointed )
         assert(callbacks->checkpoint && callbacks->postcopy);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, max_iters %u, max_factor %u, flags %u, hvm %d",
             io_fd, dom, max_iters, max_factor, flags, hvm);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45: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 1ZLAdB-0007AZ-DU; Fri, 31 Jul 2015 13:45:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd9-00079k-AR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:47 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	A2/1D-00475-A0C7BB55; Fri, 31 Jul 2015 13:45:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438350344!25490142!1
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 8852 invoked from network); 31 Jul 2015 13:45:45 -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;
	31 Jul 2015 13:45:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd6-0004dk-O7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd6-0007T4-Mu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:44 +0000
Date: Fri, 31 Jul 2015 13:45:44 +0000
Message-Id: <E1ZLAd6-0007T4-Mu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Fix trivial Coverity defects in migration v2 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 6094fe493701095414108ead0f100b18af1ccd04
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:59 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:59 2015 +0100

    tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code
    
    All of these are UNUSED_VALUE defects where a default value is
    unconditionally overwritten.  They are not particularly interesting,
    bug wise, but keeping these defects at bay helps prevent real bugs
    going unnoticed in the volume.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c        |   10 +++++-----
 tools/libxl/libxl_stream_read.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index cd2be47..58667af 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -474,7 +474,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
     unsigned x;
-    int rc = -1;
+    int rc;
 
     rc = update_progress_string(ctx, &progress_str, 0);
     if ( rc )
@@ -526,7 +526,7 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
-    int rc = -1;
+    int rc;
     DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap,
                                     &ctx->save.dirty_bitmap_hbuf);
 
@@ -573,7 +573,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
-    int rc = -1;
+    int rc;
     struct xc_sr_record rec =
     {
         .type = REC_TYPE_VERIFY,
@@ -613,7 +613,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
  */
 static int send_domain_memory_live(struct xc_sr_context *ctx)
 {
-    int rc = -1;
+    int rc;
 
     rc = enable_logdirty(ctx);
     if ( rc )
@@ -653,7 +653,7 @@ static int send_domain_memory_checkpointed(struct xc_sr_context *ctx)
 static int send_domain_memory_nonlive(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    int rc = -1;
+    int rc;
 
     rc = suspend_domain(ctx);
     if ( rc )
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 56637e2..7702b3f 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -584,7 +584,7 @@ static void write_emulator_blob(libxl__egc *egc,
     libxl__sr_emulator_hdr *emu_hdr;
     STATE_AO_GC(stream->ao);
     char path[256];
-    int rc = 0, writefd = -1;
+    int rc = 0, writefd;
 
     if (rec->hdr.length < sizeof(*emu_hdr)) {
         rc = ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:45:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45: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 1ZLAdB-0007AZ-DU; Fri, 31 Jul 2015 13:45:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd9-00079k-AR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:47 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	A2/1D-00475-A0C7BB55; Fri, 31 Jul 2015 13:45:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1438350344!25490142!1
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 8852 invoked from network); 31 Jul 2015 13:45:45 -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;
	31 Jul 2015 13:45:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd6-0004dk-O7
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAd6-0007T4-Mu
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:44 +0000
Date: Fri, 31 Jul 2015 13:45:44 +0000
Message-Id: <E1ZLAd6-0007T4-Mu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx{l,
	c}: Fix trivial Coverity defects in migration v2 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 6094fe493701095414108ead0f100b18af1ccd04
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 20 11:37:59 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:11:59 2015 +0100

    tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code
    
    All of these are UNUSED_VALUE defects where a default value is
    unconditionally overwritten.  They are not particularly interesting,
    bug wise, but keeping these defects at bay helps prevent real bugs
    going unnoticed in the volume.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c        |   10 +++++-----
 tools/libxl/libxl_stream_read.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index cd2be47..58667af 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -474,7 +474,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
     unsigned x;
-    int rc = -1;
+    int rc;
 
     rc = update_progress_string(ctx, &progress_str, 0);
     if ( rc )
@@ -526,7 +526,7 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
-    int rc = -1;
+    int rc;
     DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap,
                                     &ctx->save.dirty_bitmap_hbuf);
 
@@ -573,7 +573,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
-    int rc = -1;
+    int rc;
     struct xc_sr_record rec =
     {
         .type = REC_TYPE_VERIFY,
@@ -613,7 +613,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
  */
 static int send_domain_memory_live(struct xc_sr_context *ctx)
 {
-    int rc = -1;
+    int rc;
 
     rc = enable_logdirty(ctx);
     if ( rc )
@@ -653,7 +653,7 @@ static int send_domain_memory_checkpointed(struct xc_sr_context *ctx)
 static int send_domain_memory_nonlive(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    int rc = -1;
+    int rc;
 
     rc = suspend_domain(ctx);
     if ( rc )
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 56637e2..7702b3f 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -584,7 +584,7 @@ static void write_emulator_blob(libxl__egc *egc,
     libxl__sr_emulator_hdr *emu_hdr;
     STATE_AO_GC(stream->ao);
     char path[256];
-    int rc = 0, writefd = -1;
+    int rc = 0, writefd;
 
     if (rec->hdr.length < sizeof(*emu_hdr)) {
         rc = ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:45:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAdJ-0007EJ-Ui; Fri, 31 Jul 2015 13:45: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 1ZLAdJ-0007Dt-8A
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:57 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	03/8B-03763-41C7BB55; Fri, 31 Jul 2015 13:45:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438350355!30997749!1
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 4148 invoked from network); 31 Jul 2015 13:45:55 -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;
	31 Jul 2015 13:45:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdG-0004ds-T0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdG-0007TV-S2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:54 +0000
Date: Fri, 31 Jul 2015 13:45:54 +0000
Message-Id: <E1ZLAdG-0007TV-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly clean up array in
	libxl_list_cpupool failure path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c15bcbbcea383d1a1ac3c16cdea5ada4f26c5611
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:02 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:11 2015 +0100

    libxl: properly clean up array in libxl_list_cpupool failure path
    
    Document how cpupool_info works.  Distinguish success (ERROR_FAIL +
    ENOENT) vs failure in libxl_list_cpupool and properly clean up the array
    in failure path.
    
    Also switch to libxl__realloc and call libxl_cpupool_{init,dispose}
    where appropriate.
    
    There is change of behaviour. Previously if memory allocation fails the
    said function returns NULL. Now memory allocation failure is fatal. This
    is in line with how we deal with memory allocation failure in other
    places in libxl though.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 614ca33..083f099 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -682,6 +682,11 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
     return 0;
 }
 
+/* Returns:
+ *   0 - success
+ *   ERROR_FAIL + errno == ENOENT - no entry found
+ *   ERROR_$FOO + errno != ENOENT - other failure
+ */
 static int cpupool_info(libxl__gc *gc,
                         libxl_cpupoolinfo *info,
                         uint32_t poolid,
@@ -737,7 +742,8 @@ int libxl_cpupool_info(libxl_ctx *ctx,
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
 {
     GC_INIT(ctx);
-    libxl_cpupoolinfo info, *ptr, *tmp;
+    libxl_cpupoolinfo info, *ptr;
+
     int i;
     uint32_t poolid;
 
@@ -745,24 +751,29 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
 
     poolid = 0;
     for (i = 0;; i++) {
-        if (cpupool_info(gc, &info, poolid, false))
+        libxl_cpupoolinfo_init(&info);
+        if (cpupool_info(gc, &info, poolid, false)) {
+            libxl_cpupoolinfo_dispose(&info);
+            if (errno != ENOENT) goto out;
             break;
-        tmp = realloc(ptr, (i + 1) * sizeof(libxl_cpupoolinfo));
-        if (!tmp) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
-            libxl_cpupoolinfo_list_free(ptr, i);
-            ptr = NULL;
-            goto out;
         }
-        ptr = tmp;
+
+        ptr = libxl__realloc(NOGC, ptr, (i+1) * sizeof(libxl_cpupoolinfo));
         ptr[i] = info;
         poolid = info.poolid + 1;
+        /* Don't dispose of info because it will be returned to caller */
     }
 
     *nb_pool_out = i;
-out:
+
     GC_FREE;
     return ptr;
+
+out:
+    libxl_cpupoolinfo_list_free(ptr, i);
+    *nb_pool_out = 0;
+    GC_FREE;
+    return NULL;
 }
 
 /* this API call only list VM running on this host. A VM can
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:45:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:45:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAdJ-0007EJ-Ui; Fri, 31 Jul 2015 13:45: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 1ZLAdJ-0007Dt-8A
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:57 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	03/8B-03763-41C7BB55; Fri, 31 Jul 2015 13:45:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1438350355!30997749!1
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 4148 invoked from network); 31 Jul 2015 13:45:55 -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;
	31 Jul 2015 13:45:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdG-0004ds-T0
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdG-0007TV-S2
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:45:54 +0000
Date: Fri, 31 Jul 2015 13:45:54 +0000
Message-Id: <E1ZLAdG-0007TV-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly clean up array in
	libxl_list_cpupool failure path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c15bcbbcea383d1a1ac3c16cdea5ada4f26c5611
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:02 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:11 2015 +0100

    libxl: properly clean up array in libxl_list_cpupool failure path
    
    Document how cpupool_info works.  Distinguish success (ERROR_FAIL +
    ENOENT) vs failure in libxl_list_cpupool and properly clean up the array
    in failure path.
    
    Also switch to libxl__realloc and call libxl_cpupool_{init,dispose}
    where appropriate.
    
    There is change of behaviour. Previously if memory allocation fails the
    said function returns NULL. Now memory allocation failure is fatal. This
    is in line with how we deal with memory allocation failure in other
    places in libxl though.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 614ca33..083f099 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -682,6 +682,11 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
     return 0;
 }
 
+/* Returns:
+ *   0 - success
+ *   ERROR_FAIL + errno == ENOENT - no entry found
+ *   ERROR_$FOO + errno != ENOENT - other failure
+ */
 static int cpupool_info(libxl__gc *gc,
                         libxl_cpupoolinfo *info,
                         uint32_t poolid,
@@ -737,7 +742,8 @@ int libxl_cpupool_info(libxl_ctx *ctx,
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
 {
     GC_INIT(ctx);
-    libxl_cpupoolinfo info, *ptr, *tmp;
+    libxl_cpupoolinfo info, *ptr;
+
     int i;
     uint32_t poolid;
 
@@ -745,24 +751,29 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
 
     poolid = 0;
     for (i = 0;; i++) {
-        if (cpupool_info(gc, &info, poolid, false))
+        libxl_cpupoolinfo_init(&info);
+        if (cpupool_info(gc, &info, poolid, false)) {
+            libxl_cpupoolinfo_dispose(&info);
+            if (errno != ENOENT) goto out;
             break;
-        tmp = realloc(ptr, (i + 1) * sizeof(libxl_cpupoolinfo));
-        if (!tmp) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
-            libxl_cpupoolinfo_list_free(ptr, i);
-            ptr = NULL;
-            goto out;
         }
-        ptr = tmp;
+
+        ptr = libxl__realloc(NOGC, ptr, (i+1) * sizeof(libxl_cpupoolinfo));
         ptr[i] = info;
         poolid = info.poolid + 1;
+        /* Don't dispose of info because it will be returned to caller */
     }
 
     *nb_pool_out = i;
-out:
+
     GC_FREE;
     return ptr;
+
+out:
+    libxl_cpupoolinfo_list_free(ptr, i);
+    *nb_pool_out = 0;
+    GC_FREE;
+    return NULL;
 }
 
 /* this API call only list VM running on this host. A VM can
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:46:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAdU-0007Ha-1Q; Fri, 31 Jul 2015 13:46: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 1ZLAdT-0007HH-8W
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:07 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	3A/29-19220-E1C7BB55; Fri, 31 Jul 2015 13:46:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350365!25023910!1
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 3619 invoked from network); 31 Jul 2015 13:46:06 -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;
	31 Jul 2015 13:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdR-0004eT-4G
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdR-0007UF-0j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:05 +0000
Date: Fri, 31 Jul 2015 13:46:05 +0000
Message-Id: <E1ZLAdR-0007UF-0j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: lockdir should be lockfile in
	error message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e129b17838d38ab1e60170472573791ff3f7ae74
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: lockdir should be lockfile in error message
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index f014306..5316ad9 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -118,7 +118,7 @@ static void parse_global_config(const char *configfile,
     }
 
     if (!lockfile) {
-        fprintf(stderr, "failed to allocate lockdir\n");
+        fprintf(stderr, "failed to allocate lockfile\n");
         exit(1);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAdU-0007Ha-1Q; Fri, 31 Jul 2015 13:46: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 1ZLAdT-0007HH-8W
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:07 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	3A/29-19220-E1C7BB55; Fri, 31 Jul 2015 13:46:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350365!25023910!1
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 3619 invoked from network); 31 Jul 2015 13:46:06 -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;
	31 Jul 2015 13:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdR-0004eT-4G
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdR-0007UF-0j
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:05 +0000
Date: Fri, 31 Jul 2015 13:46:05 +0000
Message-Id: <E1ZLAdR-0007UF-0j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: lockdir should be lockfile in
	error message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e129b17838d38ab1e60170472573791ff3f7ae74
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: lockdir should be lockfile in error message
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index f014306..5316ad9 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -118,7 +118,7 @@ static void parse_global_config(const char *configfile,
     }
 
     if (!lockfile) {
-        fprintf(stderr, "failed to allocate lockdir\n");
+        fprintf(stderr, "failed to allocate lockfile\n");
         exit(1);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAdf-0007Kc-4c; Fri, 31 Jul 2015 13:46: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 1ZLAde-0007KD-2Y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EC/90-29649-92C7BB55; Fri, 31 Jul 2015 13:46:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350375!29870824!1
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 30775 invoked from network); 31 Jul 2015 13:46:16 -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;
	31 Jul 2015 13:46:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdb-0004eb-9C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdb-0007Uh-8F
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:15 +0000
Date: Fri, 31 Jul 2015 13:46:15 +0000
Message-Id: <E1ZLAdb-0007Uh-8F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_init in
	main_list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 012a261664896a68b7ee5c7f74dd48741e14023c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: call libxl_dominfo_init in main_list
    
    Always call init and dispose function on info_buf though it's not
    always used.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9755d55..74edf2c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4852,6 +4852,8 @@ int main_list(int argc, char **argv)
         break;
     }
 
+    libxl_dominfo_init(&info_buf);
+
     if (optind >= argc) {
         info = libxl_list_domain(ctx, &nb_domain);
         if (!info) {
@@ -4886,8 +4888,8 @@ int main_list(int argc, char **argv)
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
-    else
-        libxl_dominfo_dispose(info);
+
+    libxl_dominfo_dispose(&info_buf);
 
     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 Jul 31 13:46:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAdf-0007Kc-4c; Fri, 31 Jul 2015 13:46: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 1ZLAde-0007KD-2Y
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EC/90-29649-92C7BB55; Fri, 31 Jul 2015 13:46:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350375!29870824!1
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 30775 invoked from network); 31 Jul 2015 13:46:16 -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;
	31 Jul 2015 13:46:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdb-0004eb-9C
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdb-0007Uh-8F
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:15 +0000
Date: Fri, 31 Jul 2015 13:46:15 +0000
Message-Id: <E1ZLAdb-0007Uh-8F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_init in
	main_list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 012a261664896a68b7ee5c7f74dd48741e14023c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: call libxl_dominfo_init in main_list
    
    Always call init and dispose function on info_buf though it's not
    always used.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9755d55..74edf2c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4852,6 +4852,8 @@ int main_list(int argc, char **argv)
         break;
     }
 
+    libxl_dominfo_init(&info_buf);
+
     if (optind >= argc) {
         info = libxl_list_domain(ctx, &nb_domain);
         if (!info) {
@@ -4886,8 +4888,8 @@ int main_list(int argc, char **argv)
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
-    else
-        libxl_dominfo_dispose(info);
+
+    libxl_dominfo_dispose(&info_buf);
 
     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 Jul 31 13:46:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAdp-0007TA-78; Fri, 31 Jul 2015 13:46: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 1ZLAdo-0007PT-4D
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:28 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	89/9C-03763-33C7BB55; Fri, 31 Jul 2015 13:46:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350385!29870894!1
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 32508 invoked from network); 31 Jul 2015 13:46:26 -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;
	31 Jul 2015 13:46:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdl-0004eo-Ez
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdl-0007Vg-DJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:25 +0000
Date: Fri, 31 Jul 2015 13:46:25 +0000
Message-Id: <E1ZLAdl-0007Vg-DJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: valid fd can be 0 in
	main_loadpolicy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e36e4bab17319062c44902d5f7c44cc9493dc23
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: valid fd can be 0 in main_loadpolicy
    
    Initialise polFd to -1 before hand to avoid closing 0 by accident.
    
    Also fixed some style problems while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 74edf2c..9c19fbb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7851,7 +7851,7 @@ int main_setenforce(int argc, char **argv)
 int main_loadpolicy(int argc, char **argv)
 {
     const char *polFName;
-    int polFd = 0;
+    int polFd = -1;
     void *polMemCp = NULL;
     struct stat info;
     int ret;
@@ -7863,7 +7863,7 @@ int main_loadpolicy(int argc, char **argv)
 
     polFName = argv[optind];
     polFd = open(polFName, O_RDONLY);
-    if ( polFd < 0 ) {
+    if (polFd < 0) {
         fprintf(stderr, "Error occurred opening policy file '%s': %s\n",
                 polFName, strerror(errno));
         ret = -1;
@@ -7871,7 +7871,7 @@ int main_loadpolicy(int argc, char **argv)
     }
 
     ret = stat(polFName, &info);
-    if ( ret < 0 ) {
+    if (ret < 0) {
         fprintf(stderr, "Error occurred retrieving information about"
                 "policy file '%s': %s\n", polFName, strerror(errno));
         goto done;
@@ -7903,7 +7903,7 @@ int main_loadpolicy(int argc, char **argv)
 
 done:
     free(polMemCp);
-    if ( polFd > 0 )
+    if (polFd >= 0)
         close(polFd);
 
     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 Fri Jul 31 13:46:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAdp-0007TA-78; Fri, 31 Jul 2015 13:46: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 1ZLAdo-0007PT-4D
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:28 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	89/9C-03763-33C7BB55; Fri, 31 Jul 2015 13:46:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1438350385!29870894!1
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 32508 invoked from network); 31 Jul 2015 13:46:26 -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;
	31 Jul 2015 13:46:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdl-0004eo-Ez
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdl-0007Vg-DJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:25 +0000
Date: Fri, 31 Jul 2015 13:46:25 +0000
Message-Id: <E1ZLAdl-0007Vg-DJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: valid fd can be 0 in
	main_loadpolicy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e36e4bab17319062c44902d5f7c44cc9493dc23
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:19 2015 +0100

    xl: valid fd can be 0 in main_loadpolicy
    
    Initialise polFd to -1 before hand to avoid closing 0 by accident.
    
    Also fixed some style problems while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 74edf2c..9c19fbb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7851,7 +7851,7 @@ int main_setenforce(int argc, char **argv)
 int main_loadpolicy(int argc, char **argv)
 {
     const char *polFName;
-    int polFd = 0;
+    int polFd = -1;
     void *polMemCp = NULL;
     struct stat info;
     int ret;
@@ -7863,7 +7863,7 @@ int main_loadpolicy(int argc, char **argv)
 
     polFName = argv[optind];
     polFd = open(polFName, O_RDONLY);
-    if ( polFd < 0 ) {
+    if (polFd < 0) {
         fprintf(stderr, "Error occurred opening policy file '%s': %s\n",
                 polFName, strerror(errno));
         ret = -1;
@@ -7871,7 +7871,7 @@ int main_loadpolicy(int argc, char **argv)
     }
 
     ret = stat(polFName, &info);
-    if ( ret < 0 ) {
+    if (ret < 0) {
         fprintf(stderr, "Error occurred retrieving information about"
                 "policy file '%s': %s\n", polFName, strerror(errno));
         goto done;
@@ -7903,7 +7903,7 @@ int main_loadpolicy(int argc, char **argv)
 
 done:
     free(polMemCp);
-    if ( polFd > 0 )
+    if (polFd >= 0)
         close(polFd);
 
     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 Fri Jul 31 13:46:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAe0-0007fr-9z; Fri, 31 Jul 2015 13:46: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 1ZLAdy-0007do-OQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:38 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	01/3C-02380-D3C7BB55; Fri, 31 Jul 2015 13:46:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438350395!24957324!1
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 1525 invoked from network); 31 Jul 2015 13:46:36 -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;
	31 Jul 2015 13:46:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdv-0004eu-LN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdv-0007Wn-Jm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:35 +0000
Date: Fri, 31 Jul 2015 13:46:35 +0000
Message-Id: <E1ZLAdv-0007Wn-Jm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_{init,
	dispose} in main_cpupoolnumasplit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 495ec8973cbc178264696ccd8bd8323c7cd9db5f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:20 2015 +0100

    xl: call libxl_dominfo_{init, dispose} in main_cpupoolnumasplit
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9c19fbb..499a05c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7677,6 +7677,8 @@ int main_cpupoolnumasplit(int argc, char **argv)
         /* No options */
     }
 
+    libxl_dominfo_init(&info);
+
     rc = 1;
 
     libxl_bitmap_init(&cpumap);
@@ -7733,6 +7735,12 @@ int main_cpupoolnumasplit(int argc, char **argv)
         goto out;
     }
     for (c = 0; c < 10; c++) {
+        /* We've called libxl_dominfo_init before the loop and will
+         * call libxl_dominfo_dispose after the loop when we're done
+         * with info.
+         */
+        libxl_dominfo_dispose(&info);
+        libxl_dominfo_init(&info);
         if (libxl_domain_info(ctx, &info, 0)) {
             fprintf(stderr, "error on getting info for Domain-0\n");
             goto out;
@@ -7785,6 +7793,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
 out:
     libxl_cputopology_list_free(topology, n_cpus);
     libxl_bitmap_dispose(&cpumap);
+    libxl_dominfo_dispose(&info);
     free(name);
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAe0-0007fr-9z; Fri, 31 Jul 2015 13:46: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 1ZLAdy-0007do-OQ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:38 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	01/3C-02380-D3C7BB55; Fri, 31 Jul 2015 13:46:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1438350395!24957324!1
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 1525 invoked from network); 31 Jul 2015 13:46:36 -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;
	31 Jul 2015 13:46:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdv-0004eu-LN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAdv-0007Wn-Jm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:35 +0000
Date: Fri, 31 Jul 2015 13:46:35 +0000
Message-Id: <E1ZLAdv-0007Wn-Jm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: call libxl_dominfo_{init,
	dispose} in main_cpupoolnumasplit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 495ec8973cbc178264696ccd8bd8323c7cd9db5f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:20 2015 +0100

    xl: call libxl_dominfo_{init, dispose} in main_cpupoolnumasplit
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9c19fbb..499a05c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7677,6 +7677,8 @@ int main_cpupoolnumasplit(int argc, char **argv)
         /* No options */
     }
 
+    libxl_dominfo_init(&info);
+
     rc = 1;
 
     libxl_bitmap_init(&cpumap);
@@ -7733,6 +7735,12 @@ int main_cpupoolnumasplit(int argc, char **argv)
         goto out;
     }
     for (c = 0; c < 10; c++) {
+        /* We've called libxl_dominfo_init before the loop and will
+         * call libxl_dominfo_dispose after the loop when we're done
+         * with info.
+         */
+        libxl_dominfo_dispose(&info);
+        libxl_dominfo_init(&info);
         if (libxl_domain_info(ctx, &info, 0)) {
             fprintf(stderr, "error on getting info for Domain-0\n");
             goto out;
@@ -7785,6 +7793,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
 out:
     libxl_cputopology_list_free(topology, n_cpus);
     libxl_bitmap_dispose(&cpumap);
+    libxl_dominfo_dispose(&info);
     free(name);
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAe9-0007sN-D0; Fri, 31 Jul 2015 13:46:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe8-0007r4-8K
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:48 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	A9/FD-12371-74C7BB55; Fri, 31 Jul 2015 13:46:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1438350406!36946351!1
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 13259 invoked from network); 31 Jul 2015 13:46:46 -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;
	31 Jul 2015 13:46:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe5-0004f7-Qr
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe5-0007X9-PL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:45 +0000
Date: Fri, 31 Jul 2015 13:46:45 +0000
Message-Id: <E1ZLAe5-0007X9-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] python/xc: reinstate original
	implementation of next_bdf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec55a3ae01a5be34d9a753781fba41d5930569f0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:29 2015 +0100

    python/xc: reinstate original implementation of next_bdf
    
    I missed the fact that next_bdf is used to parsed user supplied
    strings when reviewing. The user supplied string is a NULL-terminated
    string separated by comma. User can supply several PCI devices in that
    string. There is, however, no delimiter for different devices, hence
    we can't change the syntax of that string.
    
    This patch reinstate the original implementation of next_bdf to
    preserve the original syntax. The last argument for xc_assign_device
    is always 0.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/xen/lowlevel/xc/xc.c |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index c8380d1..2c36eb2 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -592,8 +592,7 @@ static int token_value(char *token)
     return strtol(token, NULL, 16);
 }
 
-static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
-                    int *flag)
+static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
 {
     char *token;
 
@@ -608,17 +607,8 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-    token = strchr(token, ',') + 1;
-    if ( token ) {
-        *flag = token_value(token);
-        *str = token + 1;
-    }
-    else
-    {
-        /* O means we take "strict" as our default policy. */
-        *flag = 0;
-        *str = NULL;
-    }
+    token = strchr(token, ',');
+    *str = token ? token + 1 : NULL;
 
     return 1;
 }
@@ -630,14 +620,14 @@ static PyObject *pyxc_test_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
@@ -663,21 +653,21 @@ static PyObject *pyxc_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
         sbdf |= (dev & 0x1f) << 3;
         sbdf |= (func & 0x7);
 
-        if ( xc_assign_device(self->xc_handle, dom, sbdf, flag) != 0 )
+        if ( xc_assign_device(self->xc_handle, dom, sbdf, 0) != 0 )
         {
             if (errno == ENOSYS)
                 sbdf = -1;
@@ -696,14 +686,14 @@ static PyObject *pyxc_deassign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAe9-0007sN-D0; Fri, 31 Jul 2015 13:46:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe8-0007r4-8K
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:48 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	A9/FD-12371-74C7BB55; Fri, 31 Jul 2015 13:46:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1438350406!36946351!1
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 13259 invoked from network); 31 Jul 2015 13:46:46 -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;
	31 Jul 2015 13:46:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe5-0004f7-Qr
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAe5-0007X9-PL
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:45 +0000
Date: Fri, 31 Jul 2015 13:46:45 +0000
Message-Id: <E1ZLAe5-0007X9-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] python/xc: reinstate original
	implementation of next_bdf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec55a3ae01a5be34d9a753781fba41d5930569f0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:29 2015 +0100

    python/xc: reinstate original implementation of next_bdf
    
    I missed the fact that next_bdf is used to parsed user supplied
    strings when reviewing. The user supplied string is a NULL-terminated
    string separated by comma. User can supply several PCI devices in that
    string. There is, however, no delimiter for different devices, hence
    we can't change the syntax of that string.
    
    This patch reinstate the original implementation of next_bdf to
    preserve the original syntax. The last argument for xc_assign_device
    is always 0.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/xen/lowlevel/xc/xc.c |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index c8380d1..2c36eb2 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -592,8 +592,7 @@ static int token_value(char *token)
     return strtol(token, NULL, 16);
 }
 
-static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
-                    int *flag)
+static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
 {
     char *token;
 
@@ -608,17 +607,8 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-    token = strchr(token, ',') + 1;
-    if ( token ) {
-        *flag = token_value(token);
-        *str = token + 1;
-    }
-    else
-    {
-        /* O means we take "strict" as our default policy. */
-        *flag = 0;
-        *str = NULL;
-    }
+    token = strchr(token, ',');
+    *str = token ? token + 1 : NULL;
 
     return 1;
 }
@@ -630,14 +620,14 @@ static PyObject *pyxc_test_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
@@ -663,21 +653,21 @@ static PyObject *pyxc_assign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
         sbdf |= (dev & 0x1f) << 3;
         sbdf |= (func & 0x7);
 
-        if ( xc_assign_device(self->xc_handle, dom, sbdf, flag) != 0 )
+        if ( xc_assign_device(self->xc_handle, dom, sbdf, 0) != 0 )
         {
             if (errno == ENOSYS)
                 sbdf = -1;
@@ -696,14 +686,14 @@ static PyObject *pyxc_deassign_device(XcObject *self,
     uint32_t dom;
     char *pci_str;
     int32_t sbdf = 0;
-    int seg, bus, dev, func, flag;
+    int seg, bus, dev, func;
 
     static char *kwd_list[] = { "domid", "pci", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
                                       &dom, &pci_str) )
         return NULL;
 
-    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func, &flag) )
+    while ( next_bdf(&pci_str, &seg, &bus, &dev, &func) )
     {
         sbdf = seg << 16;
         sbdf |= (bus & 0xff) << 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAeJ-00082F-Fb; Fri, 31 Jul 2015 13:46:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeI-00081w-9i
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:58 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	29/DA-14422-15C7BB55; Fri, 31 Jul 2015 13:46:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1438350416!24990322!1
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 25846 invoked from network); 31 Jul 2015 13:46:56 -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;
	31 Jul 2015 13:46:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeG-0004fQ-0F
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeF-0007Xa-VR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:55 +0000
Date: Fri, 31 Jul 2015 13:46:55 +0000
Message-Id: <E1ZLAeF-0007Xa-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove dead code
	libxl__domain_shutdown_reason
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72b42bc623209b582ca3a4e191787f87117cae24
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:29 2015 +0100

    libxl: remove dead code libxl__domain_shutdown_reason
    
    There is no user in tree.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dom.c      |   17 -----------------
 tools/libxl/libxl_internal.h |    1 -
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b3ae5b5..5555fea 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -42,23 +42,6 @@ libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
         return LIBXL_DOMAIN_TYPE_PV;
 }
 
-int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid)
-{
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-    xc_domaininfo_t info;
-    int ret;
-
-    ret = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
-    if (ret != 1)
-        return -1;
-    if (info.domain != domid)
-        return -1;
-    if (!(info.flags & XEN_DOMINF_shutdown))
-        return -1;
-
-    return (info.flags >> XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
-}
-
 int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid)
 {
     xc_domaininfo_t info;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 89563a4..b7619a9 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1043,7 +1043,6 @@ _hidden int libxl__file_reference_unmap(libxl__file_reference *f);
 
 /* from xl_dom */
 _hidden libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid);
-_hidden int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid);
 _hidden libxl_scheduler libxl__domain_scheduler(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__sched_set_params(libxl__gc *gc, uint32_t domid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:46:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:46: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 1ZLAeJ-00082F-Fb; Fri, 31 Jul 2015 13:46:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeI-00081w-9i
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:58 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	29/DA-14422-15C7BB55; Fri, 31 Jul 2015 13:46:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1438350416!24990322!1
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 25846 invoked from network); 31 Jul 2015 13:46:56 -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;
	31 Jul 2015 13:46:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeG-0004fQ-0F
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeF-0007Xa-VR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:46:55 +0000
Date: Fri, 31 Jul 2015 13:46:55 +0000
Message-Id: <E1ZLAeF-0007Xa-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove dead code
	libxl__domain_shutdown_reason
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72b42bc623209b582ca3a4e191787f87117cae24
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jul 27 18:45:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 11:53:29 2015 +0100

    libxl: remove dead code libxl__domain_shutdown_reason
    
    There is no user in tree.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dom.c      |   17 -----------------
 tools/libxl/libxl_internal.h |    1 -
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b3ae5b5..5555fea 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -42,23 +42,6 @@ libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
         return LIBXL_DOMAIN_TYPE_PV;
 }
 
-int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid)
-{
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-    xc_domaininfo_t info;
-    int ret;
-
-    ret = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
-    if (ret != 1)
-        return -1;
-    if (info.domain != domid)
-        return -1;
-    if (!(info.flags & XEN_DOMINF_shutdown))
-        return -1;
-
-    return (info.flags >> XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
-}
-
 int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid)
 {
     xc_domaininfo_t info;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 89563a4..b7619a9 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1043,7 +1043,6 @@ _hidden int libxl__file_reference_unmap(libxl__file_reference *f);
 
 /* from xl_dom */
 _hidden libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid);
-_hidden int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid);
 _hidden libxl_scheduler libxl__domain_scheduler(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__sched_set_params(libxl__gc *gc, uint32_t domid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:47:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAeT-00084r-Ka; Fri, 31 Jul 2015 13:47: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 1ZLAeS-00084c-8m
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:08 +0000
Content-Length: 1701
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	22/C3-10422-B5C7BB55; Fri, 31 Jul 2015 13:47:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350426!24966503!1
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 29512 invoked from network); 31 Jul 2015 13:47:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeQ-0004g1-7c
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeQ-0007YX-5R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:06 +0000
Date: Fri, 31 Jul 2015 13:47:06 +0000
Message-Id: <E1ZLAeQ-0007YX-5R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif.h: document physical-device node
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1000552183674431665=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1000552183674431665==
Content-Length: 1285
Content-Transfer-Encoding: quoted-printable

commit 3e791ccb1d1d036ed25e880b1ef72ea8dcabe43a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 7 16:48:52 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 12:09:08 2015 +0100

    blkif.h: document physical-device node
    
    This node is used by toolstack (libxl, hotplug script) and blkback.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/include/public/io/blkif.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index 6baf7fb..8f0f9a6 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -92,6 +92,12 @@
  *      backend driver to open the backing device.  (e.g. the path to the
  *      file or block device representing the backing store.)
  *
+ * physical-device
+ *      Values:         "MAJOR:MINOR"
+ *
+ *      MAJOR and MINOR are the major number and minor number of the
+ *      backing device respectively.
+ *
  * type
  *      Values:         "file", "phy", "tap"
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:47:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13: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 1ZLAeT-00084r-Ka; Fri, 31 Jul 2015 13:47: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 1ZLAeS-00084c-8m
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:08 +0000
Content-Length: 1701
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	22/C3-10422-B5C7BB55; Fri, 31 Jul 2015 13:47:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350426!24966503!1
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 29512 invoked from network); 31 Jul 2015 13:47:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeQ-0004g1-7c
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeQ-0007YX-5R
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:06 +0000
Date: Fri, 31 Jul 2015 13:47:06 +0000
Message-Id: <E1ZLAeQ-0007YX-5R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif.h: document physical-device node
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1000552183674431665=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1000552183674431665==
Content-Length: 1285
Content-Transfer-Encoding: quoted-printable

commit 3e791ccb1d1d036ed25e880b1ef72ea8dcabe43a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 7 16:48:52 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 12:09:08 2015 +0100

    blkif.h: document physical-device node
    
    This node is used by toolstack (libxl, hotplug script) and blkback.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/include/public/io/blkif.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index 6baf7fb..8f0f9a6 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -92,6 +92,12 @@
  *      backend driver to open the backing device.  (e.g. the path to the
  *      file or block device representing the backing store.)
  *
+ * physical-device
+ *      Values:         "MAJOR:MINOR"
+ *
+ *      MAJOR and MINOR are the major number and minor number of the
+ *      backing device respectively.
+ *
  * type
  *      Values:         "file", "phy", "tap"
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:47:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAee-00087O-NO; Fri, 31 Jul 2015 13:47:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAec-000879-TX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	8C/0F-06179-66C7BB55; Fri, 31 Jul 2015 13:47:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350436!25024229!1
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 17725 invoked from network); 31 Jul 2015 13:47:17 -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;
	31 Jul 2015 13:47:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAea-0004gF-CE
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAea-0007Yx-BJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:16 +0000
Date: Fri, 31 Jul 2015 13:47:16 +0000
Message-Id: <E1ZLAea-0007Yx-BJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hvmloader: sync 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 2c4f5125fd5e343604a620bc621848c4bd1e6080
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Tue Jul 28 15:27:57 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:02 2015 +0100

    tools/hvmloader: sync memory map[]
    
    Currently we always use memory map[] to help hvmloader construct e820 table
    but hvmloader may have relocated RAM to support mmio allocation or just
    populated ram to ensure we can have enough room to load ovmf. Anyway we
    need to sync these changes into memory map[].
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/e820.c |  105 ++++++++++++++++++---------------------
 tools/firmware/hvmloader/pci.c  |    3 +
 tools/firmware/hvmloader/util.c |    3 +
 tools/firmware/hvmloader/util.h |    3 +
 4 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index a6cacdf..f4ccacb 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -55,6 +55,54 @@ void memory_map_setup(void)
     }
 }
 
+/*
+ * Sometimes hvmloader may have relocated RAM so low_mem_pgend/high_mem_end
+ * would be changed over there. But memory_map[] just records the
+ * original low/high memory, so we need to sync these entries once
+ * hvmloader modifies low/high memory.
+ */
+void adjust_memory_map(void)
+{
+    uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
+    unsigned int i;
+
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        uint64_t map_start = memory_map.map[i].addr;
+        uint64_t map_size = memory_map.map[i].size;
+        uint64_t map_end = map_start + map_size;
+
+        /* If we need to adjust lowmem. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             low_mem_end > map_start && low_mem_end < map_end )
+        {
+            memory_map.map[i].size = low_mem_end - map_start;
+            continue;
+        }
+
+        /* Modify the existing highmem region if it exists. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             high_mem_end && map_start == ((uint64_t)1 << 32) )
+        {
+            if ( high_mem_end != map_end )
+                memory_map.map[i].size = high_mem_end - map_start;
+            high_mem_end = 0;
+            continue;
+        }
+    }
+
+    /* If there was no highmem region, just create one. */
+    if ( high_mem_end )
+    {
+        memory_map.map[i].addr = ((uint64_t)1 << 32);
+        memory_map.map[i].size =
+                ((uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT) -
+                    memory_map.map[i].addr;
+        memory_map.map[i].type = E820_RAM;
+    }
+}
+
 void dump_e820_table(struct e820entry *e820, unsigned int nr)
 {
     uint64_t last_end = 0, start, end;
@@ -107,9 +155,6 @@ int build_e820_table(struct e820entry *e820,
 {
     unsigned int nr = 0, i, j;
     uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
-    uint32_t add_high_mem = 0;
-    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
-    uint64_t map_start, map_size, map_end;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -208,63 +253,9 @@ int build_e820_table(struct e820entry *e820,
      *
      * Note we just have one low memory entry and one high mmeory entry if
      * exists.
-     *
-     * But we may have relocated RAM to allocate sufficient MMIO previously
-     * so low_mem_pgend would be changed over there. And here memory_map[]
-     * records the original low/high memory, so if low_mem_end is less than
-     * the original we need to revise low/high memory range firstly.
      */
     for ( i = 0; i < memory_map.nr_map; i++ )
     {
-        map_start = memory_map.map[i].addr;
-        map_size = memory_map.map[i].size;
-        map_end = map_start + map_size;
-
-        /* If we need to adjust lowmem. */
-        if ( memory_map.map[i].type == E820_RAM &&
-             low_mem_end > map_start && low_mem_end < map_end )
-        {
-            add_high_mem = map_end - low_mem_end;
-            memory_map.map[i].size = low_mem_end - map_start;
-            break;
-        }
-    }
-
-    /* If we need to adjust highmem. */
-    if ( add_high_mem )
-    {
-        /* Modify the existing highmem region if it exists. */
-        for ( i = 0; i < memory_map.nr_map; i++ )
-        {
-            map_start = memory_map.map[i].addr;
-            map_size = memory_map.map[i].size;
-            map_end = map_start + map_size;
-
-            if ( memory_map.map[i].type == E820_RAM &&
-                 map_start == ((uint64_t)1 << 32))
-            {
-                memory_map.map[i].size += add_high_mem;
-                break;
-            }
-        }
-
-        /* If there was no highmem region, just create one. */
-        if ( i == memory_map.nr_map )
-        {
-            memory_map.map[i].addr = ((uint64_t)1 << 32);
-            memory_map.map[i].size = add_high_mem;
-            memory_map.map[i].type = E820_RAM;
-            memory_map.nr_map++;
-        }
-
-        /* A sanity check if high memory is broken. */
-        BUG_ON( high_mem_end !=
-                memory_map.map[i].addr + memory_map.map[i].size);
-    }
-
-    /* Now fill e820. */
-    for ( i = 0; i < memory_map.nr_map; i++ )
-    {
         e820[nr] = memory_map.map[i];
         nr++;
     }
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index ff81fba..69b98d6 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -383,6 +383,9 @@ void pci_setup(void)
         hvm_info->high_mem_pgend += nr_pages;
     }
 
+    /* Sync memory map[] if necessary. */
+    adjust_memory_map();
+
     high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
     if ( high_mem_resource.base < 1ull << 32 )
     {
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 122e3fa..32ddcd0 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -432,6 +432,9 @@ void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns)
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
     }
+
+    /* Sync memory map[]. */
+    adjust_memory_map();
 }
 
 static uint32_t alloc_up = RESERVED_MEMORY_DYNAMIC_START - 1;
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 1100a3b..132d915 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -227,6 +227,9 @@ void pci_setup(void);
 /* Setup memory map  */
 void memory_map_setup(void);
 
+/* Sync memory map */
+void adjust_memory_map(void);
+
 /* Prepare the 32bit BIOS */
 uint32_t rombios_highbios_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 Fri Jul 31 13:47:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAee-00087O-NO; Fri, 31 Jul 2015 13:47:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAec-000879-TX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	8C/0F-06179-66C7BB55; Fri, 31 Jul 2015 13:47:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350436!25024229!1
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 17725 invoked from network); 31 Jul 2015 13:47:17 -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;
	31 Jul 2015 13:47:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAea-0004gF-CE
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAea-0007Yx-BJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:16 +0000
Date: Fri, 31 Jul 2015 13:47:16 +0000
Message-Id: <E1ZLAea-0007Yx-BJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hvmloader: sync 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 2c4f5125fd5e343604a620bc621848c4bd1e6080
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Tue Jul 28 15:27:57 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:02 2015 +0100

    tools/hvmloader: sync memory map[]
    
    Currently we always use memory map[] to help hvmloader construct e820 table
    but hvmloader may have relocated RAM to support mmio allocation or just
    populated ram to ensure we can have enough room to load ovmf. Anyway we
    need to sync these changes into memory map[].
    
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/e820.c |  105 ++++++++++++++++++---------------------
 tools/firmware/hvmloader/pci.c  |    3 +
 tools/firmware/hvmloader/util.c |    3 +
 tools/firmware/hvmloader/util.h |    3 +
 4 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index a6cacdf..f4ccacb 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -55,6 +55,54 @@ void memory_map_setup(void)
     }
 }
 
+/*
+ * Sometimes hvmloader may have relocated RAM so low_mem_pgend/high_mem_end
+ * would be changed over there. But memory_map[] just records the
+ * original low/high memory, so we need to sync these entries once
+ * hvmloader modifies low/high memory.
+ */
+void adjust_memory_map(void)
+{
+    uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
+    unsigned int i;
+
+    for ( i = 0; i < memory_map.nr_map; i++ )
+    {
+        uint64_t map_start = memory_map.map[i].addr;
+        uint64_t map_size = memory_map.map[i].size;
+        uint64_t map_end = map_start + map_size;
+
+        /* If we need to adjust lowmem. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             low_mem_end > map_start && low_mem_end < map_end )
+        {
+            memory_map.map[i].size = low_mem_end - map_start;
+            continue;
+        }
+
+        /* Modify the existing highmem region if it exists. */
+        if ( memory_map.map[i].type == E820_RAM &&
+             high_mem_end && map_start == ((uint64_t)1 << 32) )
+        {
+            if ( high_mem_end != map_end )
+                memory_map.map[i].size = high_mem_end - map_start;
+            high_mem_end = 0;
+            continue;
+        }
+    }
+
+    /* If there was no highmem region, just create one. */
+    if ( high_mem_end )
+    {
+        memory_map.map[i].addr = ((uint64_t)1 << 32);
+        memory_map.map[i].size =
+                ((uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT) -
+                    memory_map.map[i].addr;
+        memory_map.map[i].type = E820_RAM;
+    }
+}
+
 void dump_e820_table(struct e820entry *e820, unsigned int nr)
 {
     uint64_t last_end = 0, start, end;
@@ -107,9 +155,6 @@ int build_e820_table(struct e820entry *e820,
 {
     unsigned int nr = 0, i, j;
     uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
-    uint32_t add_high_mem = 0;
-    uint64_t high_mem_end = (uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT;
-    uint64_t map_start, map_size, map_end;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -208,63 +253,9 @@ int build_e820_table(struct e820entry *e820,
      *
      * Note we just have one low memory entry and one high mmeory entry if
      * exists.
-     *
-     * But we may have relocated RAM to allocate sufficient MMIO previously
-     * so low_mem_pgend would be changed over there. And here memory_map[]
-     * records the original low/high memory, so if low_mem_end is less than
-     * the original we need to revise low/high memory range firstly.
      */
     for ( i = 0; i < memory_map.nr_map; i++ )
     {
-        map_start = memory_map.map[i].addr;
-        map_size = memory_map.map[i].size;
-        map_end = map_start + map_size;
-
-        /* If we need to adjust lowmem. */
-        if ( memory_map.map[i].type == E820_RAM &&
-             low_mem_end > map_start && low_mem_end < map_end )
-        {
-            add_high_mem = map_end - low_mem_end;
-            memory_map.map[i].size = low_mem_end - map_start;
-            break;
-        }
-    }
-
-    /* If we need to adjust highmem. */
-    if ( add_high_mem )
-    {
-        /* Modify the existing highmem region if it exists. */
-        for ( i = 0; i < memory_map.nr_map; i++ )
-        {
-            map_start = memory_map.map[i].addr;
-            map_size = memory_map.map[i].size;
-            map_end = map_start + map_size;
-
-            if ( memory_map.map[i].type == E820_RAM &&
-                 map_start == ((uint64_t)1 << 32))
-            {
-                memory_map.map[i].size += add_high_mem;
-                break;
-            }
-        }
-
-        /* If there was no highmem region, just create one. */
-        if ( i == memory_map.nr_map )
-        {
-            memory_map.map[i].addr = ((uint64_t)1 << 32);
-            memory_map.map[i].size = add_high_mem;
-            memory_map.map[i].type = E820_RAM;
-            memory_map.nr_map++;
-        }
-
-        /* A sanity check if high memory is broken. */
-        BUG_ON( high_mem_end !=
-                memory_map.map[i].addr + memory_map.map[i].size);
-    }
-
-    /* Now fill e820. */
-    for ( i = 0; i < memory_map.nr_map; i++ )
-    {
         e820[nr] = memory_map.map[i];
         nr++;
     }
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index ff81fba..69b98d6 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -383,6 +383,9 @@ void pci_setup(void)
         hvm_info->high_mem_pgend += nr_pages;
     }
 
+    /* Sync memory map[] if necessary. */
+    adjust_memory_map();
+
     high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
     if ( high_mem_resource.base < 1ull << 32 )
     {
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 122e3fa..32ddcd0 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -432,6 +432,9 @@ void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns)
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
     }
+
+    /* Sync memory map[]. */
+    adjust_memory_map();
 }
 
 static uint32_t alloc_up = RESERVED_MEMORY_DYNAMIC_START - 1;
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 1100a3b..132d915 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -227,6 +227,9 @@ void pci_setup(void);
 /* Setup memory map  */
 void memory_map_setup(void);
 
+/* Sync memory map */
+void adjust_memory_map(void);
+
 /* Prepare the 32bit BIOS */
 uint32_t rombios_highbios_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 Fri Jul 31 13:47:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAeo-00089E-Q5; Fri, 31 Jul 2015 13:47:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAem-000891-Rl
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:28 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	37/64-10422-07C7BB55; Fri, 31 Jul 2015 13:47:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350446!24966591!1
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 31785 invoked from network); 31 Jul 2015 13:47:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAek-0004gQ-Hw
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAek-0007ZK-GK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:26 +0000
Date: Fri, 31 Jul 2015 13:47:26 +0000
Message-Id: <E1ZLAek-0007ZK-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Do not set stream->rc in
	stream_complete()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d3e1ee37e12c13a9cefb9b1442fa4148363a6f4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 27 17:47:25 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:18 2015 +0100

    tools/libxl: Do not set stream->rc in stream_complete()
    
    Only ever set stream->rc in check_all_finished().  The first version of
    the migration v2 series had separate rc and joined_rc parameters, where
    this logic worked.  However when combining the two, the teardown path
    fails to trigger if stream_complete() records stream->rc itself.  A side
    effect of this is that stream_done() needs to take an rc parameter.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   10 ++++------
 tools/libxl/libxl_stream_write.c |   10 ++++------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 7702b3f..e2dad35 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -112,7 +112,7 @@ static void stream_complete(libxl__egc *egc,
 static void checkpoint_done(libxl__egc *egc,
                             libxl__stream_read_state *stream, int rc);
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_read_state *stream);
+                        libxl__stream_read_state *stream, int rc);
 static void conversion_done(libxl__egc *egc,
                             libxl__conversion_helper_state *chs, int rc);
 static void check_all_finished(libxl__egc *egc,
@@ -669,9 +669,7 @@ static void stream_complete(libxl__egc *egc,
         return;
     }
 
-    if (!stream->rc)
-        stream->rc = rc;
-    stream_done(egc, stream);
+    stream_done(egc, stream, rc);
 }
 
 static void checkpoint_done(libxl__egc *egc,
@@ -695,7 +693,7 @@ static void checkpoint_done(libxl__egc *egc,
 }
 
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_read_state *stream)
+                        libxl__stream_read_state *stream, int rc)
 {
     libxl__sr_record_buf *rec, *trec;
 
@@ -720,7 +718,7 @@ static void stream_done(libxl__egc *egc,
     LIBXL_STAILQ_FOREACH_SAFE(rec, &stream->record_queue, entry, trec)
         free_record(rec);
 
-    check_all_finished(egc, stream, stream->rc);
+    check_all_finished(egc, stream, rc);
 }
 
 void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 5bff52b..ec46105 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -55,7 +55,7 @@ static void stream_success(libxl__egc *egc,
 static void stream_complete(libxl__egc *egc,
                             libxl__stream_write_state *stream, int rc);
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_write_state *stream);
+                        libxl__stream_write_state *stream, int rc);
 static void checkpoint_done(libxl__egc *egc,
                             libxl__stream_write_state *stream,
                             int rc);
@@ -492,13 +492,11 @@ static void stream_complete(libxl__egc *egc,
         return;
     }
 
-    if (!stream->rc)
-        stream->rc = rc;
-    stream_done(egc, stream);
+    stream_done(egc, stream, rc);
 }
 
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_write_state *stream)
+                        libxl__stream_write_state *stream, int rc)
 {
     assert(stream->running);
     stream->running = false;
@@ -507,7 +505,7 @@ static void stream_done(libxl__egc *egc,
         libxl__carefd_close(stream->emu_carefd);
     free(stream->emu_body);
 
-    check_all_finished(egc, stream, stream->rc);
+    check_all_finished(egc, stream, rc);
 }
 
 static void checkpoint_done(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:47:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZLAeo-00089E-Q5; Fri, 31 Jul 2015 13:47:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAem-000891-Rl
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:28 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	37/64-10422-07C7BB55; Fri, 31 Jul 2015 13:47:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1438350446!24966591!1
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 31785 invoked from network); 31 Jul 2015 13:47:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAek-0004gQ-Hw
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAek-0007ZK-GK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:26 +0000
Date: Fri, 31 Jul 2015 13:47:26 +0000
Message-Id: <E1ZLAek-0007ZK-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Do not set stream->rc in
	stream_complete()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d3e1ee37e12c13a9cefb9b1442fa4148363a6f4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 27 17:47:25 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:18 2015 +0100

    tools/libxl: Do not set stream->rc in stream_complete()
    
    Only ever set stream->rc in check_all_finished().  The first version of
    the migration v2 series had separate rc and joined_rc parameters, where
    this logic worked.  However when combining the two, the teardown path
    fails to trigger if stream_complete() records stream->rc itself.  A side
    effect of this is that stream_done() needs to take an rc parameter.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   10 ++++------
 tools/libxl/libxl_stream_write.c |   10 ++++------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 7702b3f..e2dad35 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -112,7 +112,7 @@ static void stream_complete(libxl__egc *egc,
 static void checkpoint_done(libxl__egc *egc,
                             libxl__stream_read_state *stream, int rc);
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_read_state *stream);
+                        libxl__stream_read_state *stream, int rc);
 static void conversion_done(libxl__egc *egc,
                             libxl__conversion_helper_state *chs, int rc);
 static void check_all_finished(libxl__egc *egc,
@@ -669,9 +669,7 @@ static void stream_complete(libxl__egc *egc,
         return;
     }
 
-    if (!stream->rc)
-        stream->rc = rc;
-    stream_done(egc, stream);
+    stream_done(egc, stream, rc);
 }
 
 static void checkpoint_done(libxl__egc *egc,
@@ -695,7 +693,7 @@ static void checkpoint_done(libxl__egc *egc,
 }
 
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_read_state *stream)
+                        libxl__stream_read_state *stream, int rc)
 {
     libxl__sr_record_buf *rec, *trec;
 
@@ -720,7 +718,7 @@ static void stream_done(libxl__egc *egc,
     LIBXL_STAILQ_FOREACH_SAFE(rec, &stream->record_queue, entry, trec)
         free_record(rec);
 
-    check_all_finished(egc, stream, stream->rc);
+    check_all_finished(egc, stream, rc);
 }
 
 void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 5bff52b..ec46105 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -55,7 +55,7 @@ static void stream_success(libxl__egc *egc,
 static void stream_complete(libxl__egc *egc,
                             libxl__stream_write_state *stream, int rc);
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_write_state *stream);
+                        libxl__stream_write_state *stream, int rc);
 static void checkpoint_done(libxl__egc *egc,
                             libxl__stream_write_state *stream,
                             int rc);
@@ -492,13 +492,11 @@ static void stream_complete(libxl__egc *egc,
         return;
     }
 
-    if (!stream->rc)
-        stream->rc = rc;
-    stream_done(egc, stream);
+    stream_done(egc, stream, rc);
 }
 
 static void stream_done(libxl__egc *egc,
-                        libxl__stream_write_state *stream)
+                        libxl__stream_write_state *stream, int rc)
 {
     assert(stream->running);
     stream->running = false;
@@ -507,7 +505,7 @@ static void stream_done(libxl__egc *egc,
         libxl__carefd_close(stream->emu_carefd);
     free(stream->emu_body);
 
-    check_all_finished(egc, stream, stream->rc);
+    check_all_finished(egc, stream, rc);
 }
 
 static void checkpoint_done(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:47:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAey-0008As-Sa; Fri, 31 Jul 2015 13:47:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAex-0008Ad-C3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:39 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	AE/78-04752-A7C7BB55; Fri, 31 Jul 2015 13:47:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438350456!36926448!1
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 3142 invoked from network); 31 Jul 2015 13:47:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeu-0004gY-My
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeu-0007aE-Ln
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:36 +0000
Date: Fri, 31 Jul 2015 13:47:36 +0000
Message-Id: <E1ZLAeu-0007aE-Ln@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Do not fire the stream
	callback multiple times
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44313ab77f3e3c5b566ea4f23b0e32bfd5eafa29
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 27 17:47:26 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:18 2015 +0100

    tools/libxl: Do not fire the stream callback multiple times
    
    Avoid stacking of check_all_finished() via synchronous teardown of
    tasks.  If the _abort() functions call back synchronously,
    stream->completion_callback() ends up getting called twice, as first
    and last check_all_finished() frames observe each task being finished.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.h     |    2 ++
 tools/libxl/libxl_stream_read.c  |   21 +++++++++++++++++++++
 tools/libxl/libxl_stream_write.c |   21 +++++++++++++++++++++
 3 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b7619a9..911de2d 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3009,6 +3009,7 @@ struct libxl__stream_write_state {
     int rc;
     bool running;
     bool in_checkpoint;
+    bool sync_teardown;  /* Only used to coordinate shutdown on error path. */
     libxl__save_helper_state shs;
 
     /* Main stream-writing data. */
@@ -3350,6 +3351,7 @@ struct libxl__stream_read_state {
     int rc;
     bool running;
     bool in_checkpoint;
+    bool sync_teardown; /* Only used to coordinate shutdown on error path. */
     libxl__save_helper_state shs;
     libxl__conversion_helper_state chs;
 
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index e2dad35..d54789c 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -176,6 +176,7 @@ void libxl__stream_read_init(libxl__stream_read_state *stream)
     stream->rc = 0;
     stream->running = false;
     stream->in_checkpoint = false;
+    stream->sync_teardown = false;
     libxl__save_helper_init(&stream->shs);
     libxl__conversion_helper_init(&stream->chs);
     FILLZERO(stream->dc);
@@ -760,13 +761,33 @@ static void check_all_finished(libxl__egc *egc,
 {
     STATE_AO_GC(stream->ao);
 
+    /*
+     * In the case of a failure, the _abort()'s below might cancel
+     * synchronously on top of us, or asynchronously at a later point.
+     *
+     * We must avoid the situation where all _abort() cancel
+     * synchronously and the completion_callback() gets called twice;
+     * once by the first error and once by the final stacked abort(),
+     * both of whom will find that all of the tasks have stopped.
+     *
+     * To avoid this problem, any stacked re-entry into this function is
+     * ineligible to fire the completion callback.  The outermost
+     * instance will take care of completing, once the stack has
+     * unwound.
+     */
+    if (stream->sync_teardown)
+        return;
+
     if (!stream->rc && rc) {
         /* First reported failure. Tear everything down. */
         stream->rc = rc;
+        stream->sync_teardown = true;
 
         libxl__stream_read_abort(egc, stream, rc);
         libxl__save_helper_abort(egc, &stream->shs);
         libxl__conversion_helper_abort(egc, &stream->chs, rc);
+
+        stream->sync_teardown = false;
     }
 
     /* Don't fire the callback until all our parallel tasks have stopped. */
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index ec46105..676ad0a 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -158,6 +158,7 @@ void libxl__stream_write_init(libxl__stream_write_state *stream)
     stream->rc = 0;
     stream->running = false;
     stream->in_checkpoint = false;
+    stream->sync_teardown = false;
     FILLZERO(stream->dc);
     stream->record_done_callback = NULL;
     FILLZERO(stream->emu_dc);
@@ -524,12 +525,32 @@ static void check_all_finished(libxl__egc *egc,
 {
     STATE_AO_GC(stream->ao);
 
+    /*
+     * In the case of a failure, the _abort()'s below might cancel
+     * synchronously on top of us, or asynchronously at a later point.
+     *
+     * We must avoid the situation where all _abort() cancel
+     * synchronously and the completion_callback() gets called twice;
+     * once by the first error and once by the final stacked abort(),
+     * both of whom will find that all of the tasks have stopped.
+     *
+     * To avoid this problem, any stacked re-entry into this function is
+     * ineligible to fire the completion callback.  The outermost
+     * instance will take care of completing, once the stack has
+     * unwound.
+     */
+    if (stream->sync_teardown)
+        return;
+
     if (!stream->rc && rc) {
         /* First reported failure. Tear everything down. */
         stream->rc = rc;
+        stream->sync_teardown = true;
 
         libxl__stream_write_abort(egc, stream, rc);
         libxl__save_helper_abort(egc, &stream->shs);
+
+        stream->sync_teardown = false;
     }
 
     /* Don't fire the callback until all our parallel tasks have stopped. */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:47:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAey-0008As-Sa; Fri, 31 Jul 2015 13:47:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAex-0008Ad-C3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:39 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	AE/78-04752-A7C7BB55; Fri, 31 Jul 2015 13:47:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1438350456!36926448!1
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 3142 invoked from network); 31 Jul 2015 13:47:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:47:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeu-0004gY-My
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAeu-0007aE-Ln
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:36 +0000
Date: Fri, 31 Jul 2015 13:47:36 +0000
Message-Id: <E1ZLAeu-0007aE-Ln@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Do not fire the stream
	callback multiple times
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44313ab77f3e3c5b566ea4f23b0e32bfd5eafa29
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 27 17:47:26 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jul 28 14:02:18 2015 +0100

    tools/libxl: Do not fire the stream callback multiple times
    
    Avoid stacking of check_all_finished() via synchronous teardown of
    tasks.  If the _abort() functions call back synchronously,
    stream->completion_callback() ends up getting called twice, as first
    and last check_all_finished() frames observe each task being finished.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.h     |    2 ++
 tools/libxl/libxl_stream_read.c  |   21 +++++++++++++++++++++
 tools/libxl/libxl_stream_write.c |   21 +++++++++++++++++++++
 3 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b7619a9..911de2d 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3009,6 +3009,7 @@ struct libxl__stream_write_state {
     int rc;
     bool running;
     bool in_checkpoint;
+    bool sync_teardown;  /* Only used to coordinate shutdown on error path. */
     libxl__save_helper_state shs;
 
     /* Main stream-writing data. */
@@ -3350,6 +3351,7 @@ struct libxl__stream_read_state {
     int rc;
     bool running;
     bool in_checkpoint;
+    bool sync_teardown; /* Only used to coordinate shutdown on error path. */
     libxl__save_helper_state shs;
     libxl__conversion_helper_state chs;
 
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index e2dad35..d54789c 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -176,6 +176,7 @@ void libxl__stream_read_init(libxl__stream_read_state *stream)
     stream->rc = 0;
     stream->running = false;
     stream->in_checkpoint = false;
+    stream->sync_teardown = false;
     libxl__save_helper_init(&stream->shs);
     libxl__conversion_helper_init(&stream->chs);
     FILLZERO(stream->dc);
@@ -760,13 +761,33 @@ static void check_all_finished(libxl__egc *egc,
 {
     STATE_AO_GC(stream->ao);
 
+    /*
+     * In the case of a failure, the _abort()'s below might cancel
+     * synchronously on top of us, or asynchronously at a later point.
+     *
+     * We must avoid the situation where all _abort() cancel
+     * synchronously and the completion_callback() gets called twice;
+     * once by the first error and once by the final stacked abort(),
+     * both of whom will find that all of the tasks have stopped.
+     *
+     * To avoid this problem, any stacked re-entry into this function is
+     * ineligible to fire the completion callback.  The outermost
+     * instance will take care of completing, once the stack has
+     * unwound.
+     */
+    if (stream->sync_teardown)
+        return;
+
     if (!stream->rc && rc) {
         /* First reported failure. Tear everything down. */
         stream->rc = rc;
+        stream->sync_teardown = true;
 
         libxl__stream_read_abort(egc, stream, rc);
         libxl__save_helper_abort(egc, &stream->shs);
         libxl__conversion_helper_abort(egc, &stream->chs, rc);
+
+        stream->sync_teardown = false;
     }
 
     /* Don't fire the callback until all our parallel tasks have stopped. */
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index ec46105..676ad0a 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -158,6 +158,7 @@ void libxl__stream_write_init(libxl__stream_write_state *stream)
     stream->rc = 0;
     stream->running = false;
     stream->in_checkpoint = false;
+    stream->sync_teardown = false;
     FILLZERO(stream->dc);
     stream->record_done_callback = NULL;
     FILLZERO(stream->emu_dc);
@@ -524,12 +525,32 @@ static void check_all_finished(libxl__egc *egc,
 {
     STATE_AO_GC(stream->ao);
 
+    /*
+     * In the case of a failure, the _abort()'s below might cancel
+     * synchronously on top of us, or asynchronously at a later point.
+     *
+     * We must avoid the situation where all _abort() cancel
+     * synchronously and the completion_callback() gets called twice;
+     * once by the first error and once by the final stacked abort(),
+     * both of whom will find that all of the tasks have stopped.
+     *
+     * To avoid this problem, any stacked re-entry into this function is
+     * ineligible to fire the completion callback.  The outermost
+     * instance will take care of completing, once the stack has
+     * unwound.
+     */
+    if (stream->sync_teardown)
+        return;
+
     if (!stream->rc && rc) {
         /* First reported failure. Tear everything down. */
         stream->rc = rc;
+        stream->sync_teardown = true;
 
         libxl__stream_write_abort(egc, stream, rc);
         libxl__save_helper_abort(egc, &stream->shs);
+
+        stream->sync_teardown = false;
     }
 
     /* Don't fire the callback until all our parallel tasks have stopped. */
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:47:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAf8-0008Cd-V6; Fri, 31 Jul 2015 13: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 1ZLAf7-0008CM-A1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:49 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	8C/20-00475-48C7BB55; Fri, 31 Jul 2015 13:47:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438350467!36932703!1
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 527 invoked from network); 31 Jul 2015 13: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;
	31 Jul 2015 13:47:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAf4-0004gg-SN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAf4-0007ah-RN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:46 +0000
Date: Fri, 31 Jul 2015 13:47:46 +0000
Message-Id: <E1ZLAf4-0007ah-RN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Only continue stream
	operations if the stream is still in progress
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a636d4fc2f329566ddc1afff04d833281d8a07eb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 28 22:44:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:24:50 2015 +0100

    tools/libxl: Only continue stream operations if the stream is still in progress
    
    Part of the callback contract with check_all_finished() is that each
    running parallel task shall call it exactly once.
    
    Previously, it was possible for stream_continue() or
    write_toolstack_record() to fail and call into check_all_finished().  As
    the save helpers callback has fired, it no longer counts as in use,
    which causes check_all_finished() to fire the stream callback.  Then,
    unwinding the stack back and calling check_all_finished() a second time
    results in the same conditions being observed, and the stream callback
    being fired a second time.
    
    To avoid this, check_all_finished() is called before any other actions
    which continue the stream functionality, and the stream is only
    continued if it has not been torn down.  This guarantees not to continue
    stream operations if the stream does not owe a callback to
    check_all_finished().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   20 ++++++++++++++------
 tools/libxl/libxl_stream_write.c |   11 +++++++++--
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index d54789c..fd3675c 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -738,14 +738,22 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
         goto err;
     }
 
-    /*
-     * Libxc has indicated that it is done with the stream.  Resume reading
-     * libxl records from it.
-     */
-    stream_continue(egc, stream);
-
  err:
     check_all_finished(egc, stream, rc);
+
+    /*
+     * This function is the callback associated with the save helper
+     * task, not the stream task.  We do not know whether the stream is
+     * alive, and check_all_finished() may have torn it down around us.
+     * If the stream is not still alive, we must not continue any work.
+     */
+    if (libxl__stream_read_inuse(stream)) {
+        /*
+         * Libxc has indicated that it is done with the stream.  Resume reading
+         * libxl records from it.
+         */
+        stream_continue(egc, stream);
+    }
 }
 
 static void conversion_done(libxl__egc *egc,
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 676ad0a..9e9c998 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -275,10 +275,17 @@ void libxl__xc_domain_save_done(libxl__egc *egc, void *dss_void,
         goto err;
     }
 
-    write_toolstack_record(egc, stream);
-
  err:
     check_all_finished(egc, stream, rc);
+
+    /*
+     * This function is the callback associated with the save helper
+     * task, not the stream task.  We do not know whether the stream is
+     * alive, and check_all_finished() may have torn it down around us.
+     * If the stream is not still alive, we must not continue any work.
+     */
+    if (libxl__stream_write_inuse(stream))
+        write_toolstack_record(egc, stream);
 }
 
 static void write_toolstack_record(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:47:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:47: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 1ZLAf8-0008Cd-V6; Fri, 31 Jul 2015 13: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 1ZLAf7-0008CM-A1
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:49 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	8C/20-00475-48C7BB55; Fri, 31 Jul 2015 13:47:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1438350467!36932703!1
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 527 invoked from network); 31 Jul 2015 13: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;
	31 Jul 2015 13:47:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAf4-0004gg-SN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAf4-0007ah-RN
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:46 +0000
Date: Fri, 31 Jul 2015 13:47:46 +0000
Message-Id: <E1ZLAf4-0007ah-RN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Only continue stream
	operations if the stream is still in progress
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a636d4fc2f329566ddc1afff04d833281d8a07eb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 28 22:44:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:24:50 2015 +0100

    tools/libxl: Only continue stream operations if the stream is still in progress
    
    Part of the callback contract with check_all_finished() is that each
    running parallel task shall call it exactly once.
    
    Previously, it was possible for stream_continue() or
    write_toolstack_record() to fail and call into check_all_finished().  As
    the save helpers callback has fired, it no longer counts as in use,
    which causes check_all_finished() to fire the stream callback.  Then,
    unwinding the stack back and calling check_all_finished() a second time
    results in the same conditions being observed, and the stream callback
    being fired a second time.
    
    To avoid this, check_all_finished() is called before any other actions
    which continue the stream functionality, and the stream is only
    continued if it has not been torn down.  This guarantees not to continue
    stream operations if the stream does not owe a callback to
    check_all_finished().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_stream_read.c  |   20 ++++++++++++++------
 tools/libxl/libxl_stream_write.c |   11 +++++++++--
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index d54789c..fd3675c 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -738,14 +738,22 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
         goto err;
     }
 
-    /*
-     * Libxc has indicated that it is done with the stream.  Resume reading
-     * libxl records from it.
-     */
-    stream_continue(egc, stream);
-
  err:
     check_all_finished(egc, stream, rc);
+
+    /*
+     * This function is the callback associated with the save helper
+     * task, not the stream task.  We do not know whether the stream is
+     * alive, and check_all_finished() may have torn it down around us.
+     * If the stream is not still alive, we must not continue any work.
+     */
+    if (libxl__stream_read_inuse(stream)) {
+        /*
+         * Libxc has indicated that it is done with the stream.  Resume reading
+         * libxl records from it.
+         */
+        stream_continue(egc, stream);
+    }
 }
 
 static void conversion_done(libxl__egc *egc,
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 676ad0a..9e9c998 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -275,10 +275,17 @@ void libxl__xc_domain_save_done(libxl__egc *egc, void *dss_void,
         goto err;
     }
 
-    write_toolstack_record(egc, stream);
-
  err:
     check_all_finished(egc, stream, rc);
+
+    /*
+     * This function is the callback associated with the save helper
+     * task, not the stream task.  We do not know whether the stream is
+     * alive, and check_all_finished() may have torn it down around us.
+     * If the stream is not still alive, we must not continue any work.
+     */
+    if (libxl__stream_write_inuse(stream))
+        write_toolstack_record(egc, stream);
 }
 
 static void write_toolstack_record(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:48:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfI-0008EZ-3w; Fri, 31 Jul 2015 13:48:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfH-0008EK-FK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:59 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	13/F8-04752-E8C7BB55; Fri, 31 Jul 2015 13:47:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1438350477!36898552!1
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 13963 invoked from network); 31 Jul 2015 13:47:58 -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;
	31 Jul 2015 13:47:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfF-0004go-19
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfE-0007b6-Vx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:57 +0000
Date: Fri, 31 Jul 2015 13:47:56 +0000
Message-Id: <E1ZLAfE-0007b6-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Assert that
	libxl__ao_inprogress_gc() is not called with NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 371e7eff4b067f3ec923a49f1c446b8169e7d701
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 28 22:44:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:25:08 2015 +0100

    tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL
    
    libxl__ao_inprogress_gc() is hidden behind various macros used to
    construct local variables.  Assert() that NULL is not passed, to make
    such an error very obvious, rather than a plain segfault at 0.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 8acecfa..bfb6b31 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1862,6 +1862,7 @@ void libxl__ao_create_fail(libxl__ao *ao)
 
 libxl__gc *libxl__ao_inprogress_gc(libxl__ao *ao)
 {
+    assert(ao);
     assert(ao->magic == LIBXL__AO_MAGIC);
     assert(!ao->complete);
     return &ao->gc;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:48:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfI-0008EZ-3w; Fri, 31 Jul 2015 13:48:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfH-0008EK-FK
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:59 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	13/F8-04752-E8C7BB55; Fri, 31 Jul 2015 13:47:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1438350477!36898552!1
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 13963 invoked from network); 31 Jul 2015 13:47:58 -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;
	31 Jul 2015 13:47:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfF-0004go-19
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfE-0007b6-Vx
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:47:57 +0000
Date: Fri, 31 Jul 2015 13:47:56 +0000
Message-Id: <E1ZLAfE-0007b6-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Assert that
	libxl__ao_inprogress_gc() is not called with NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 371e7eff4b067f3ec923a49f1c446b8169e7d701
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jul 28 22:44:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:25:08 2015 +0100

    tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL
    
    libxl__ao_inprogress_gc() is hidden behind various macros used to
    construct local variables.  Assert() that NULL is not passed, to make
    such an error very obvious, rather than a plain segfault at 0.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 8acecfa..bfb6b31 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1862,6 +1862,7 @@ void libxl__ao_create_fail(libxl__ao *ao)
 
 libxl__gc *libxl__ao_inprogress_gc(libxl__ao *ao)
 {
+    assert(ao);
     assert(ao->magic == LIBXL__AO_MAGIC);
     assert(!ao->complete);
     return &ao->gc;
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:48:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfS-0008Gm-6s; Fri, 31 Jul 2015 13:48: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 1ZLAfR-0008GV-G3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:09 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	24/0C-01421-89C7BB55; Fri, 31 Jul 2015 13:48:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350487!31175118!1
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 23262 invoked from network); 31 Jul 2015 13:48: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;
	31 Jul 2015 13:48:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfP-0004hP-6n
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfP-0007bj-5p
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:07 +0000
Date: Fri, 31 Jul 2015 13:48:07 +0000
Message-Id: <E1ZLAfP-0007bj-5p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxlu: properly free buffer in PCI
	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 4dcec65f7cb0db025794eeddedebf4ea5fc81d8e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 28 17:23:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:26:56 2015 +0100

    libxlu: properly free buffer in PCI related functions
    
    Free buffer in both success and failure paths.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxlu_pci.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxlu_pci.c b/tools/libxl/libxlu_pci.c
index 026413b..2cd793d 100644
--- a/tools/libxl/libxlu_pci.c
+++ b/tools/libxl/libxlu_pci.c
@@ -167,17 +167,18 @@ int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str
         }
     }
 
-    free(buf2);
-
     if ( tok != ptr || state != STATE_TERMINAL )
         goto parse_error;
 
     /* Just a pretty way to fill in the values */
     pcidev_struct_fill(pcidev, dom, bus, dev, func, vslot << 3);
 
+    free(buf2);
+
     return 0;
 
 parse_error:
+    free(buf2);
     return ERROR_INVAL;
 }
 
@@ -246,14 +247,15 @@ int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)
         }
     }
 
-    free(buf2);
-
     if (tok != ptr || state != STATE_TERMINAL)
         goto parse_error;
 
+    free(buf2);
+
     return 0;
 
 parse_error:
+    free(buf2);
     return ERROR_INVAL;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:48:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfS-0008Gm-6s; Fri, 31 Jul 2015 13:48: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 1ZLAfR-0008GV-G3
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:09 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	24/0C-01421-89C7BB55; Fri, 31 Jul 2015 13:48:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350487!31175118!1
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 23262 invoked from network); 31 Jul 2015 13:48: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;
	31 Jul 2015 13:48:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfP-0004hP-6n
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfP-0007bj-5p
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:07 +0000
Date: Fri, 31 Jul 2015 13:48:07 +0000
Message-Id: <E1ZLAfP-0007bj-5p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxlu: properly free buffer in PCI
	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 4dcec65f7cb0db025794eeddedebf4ea5fc81d8e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 28 17:23:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 15:26:56 2015 +0100

    libxlu: properly free buffer in PCI related functions
    
    Free buffer in both success and failure paths.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxlu_pci.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxlu_pci.c b/tools/libxl/libxlu_pci.c
index 026413b..2cd793d 100644
--- a/tools/libxl/libxlu_pci.c
+++ b/tools/libxl/libxlu_pci.c
@@ -167,17 +167,18 @@ int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str
         }
     }
 
-    free(buf2);
-
     if ( tok != ptr || state != STATE_TERMINAL )
         goto parse_error;
 
     /* Just a pretty way to fill in the values */
     pcidev_struct_fill(pcidev, dom, bus, dev, func, vslot << 3);
 
+    free(buf2);
+
     return 0;
 
 parse_error:
+    free(buf2);
     return ERROR_INVAL;
 }
 
@@ -246,14 +247,15 @@ int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)
         }
     }
 
-    free(buf2);
-
     if (tok != ptr || state != STATE_TERMINAL)
         goto parse_error;
 
+    free(buf2);
+
     return 0;
 
 parse_error:
+    free(buf2);
     return ERROR_INVAL;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jul 31 13:48:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfc-0008J3-9F; Fri, 31 Jul 2015 13:48: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 1ZLAfb-0008Iq-Nv
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	64/CF-03763-3AC7BB55; Fri, 31 Jul 2015 13:48:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350497!31175175!1
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 1097 invoked from network); 31 Jul 2015 13:48:18 -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;
	31 Jul 2015 13:48:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfZ-0004hX-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfZ-0007c6-Ad
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:17 +0000
Date: Fri, 31 Jul 2015 13:48:17 +0000
Message-Id: <E1ZLAfZ-0007c6-Ad@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bec4b89b02f0b28c43db102d83f11b2b2e61bb4
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Jul 29 16:32:48 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:48 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index effc470..e9a7097 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 ?= 3e2e51ecc1120bd59537ed19b6bc7066511c7e2e
-# Sun May 24 10:53:44 2015 +0200
-# pcnet: force the buffer access to be in bounds during tx
+QEMU_TRADITIONAL_REVISION ?= 7f057440b31da38196e3398fd1b618fc36ad97d6
+# Wed Jun 3 14:41:27 2015 +0200
+# ide: Clear DRQ after handling all expected accesses
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:48:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfc-0008J3-9F; Fri, 31 Jul 2015 13:48: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 1ZLAfb-0008Iq-Nv
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	64/CF-03763-3AC7BB55; Fri, 31 Jul 2015 13:48:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1438350497!31175175!1
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 1097 invoked from network); 31 Jul 2015 13:48:18 -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;
	31 Jul 2015 13:48:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfZ-0004hX-Bf
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfZ-0007c6-Ad
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:17 +0000
Date: Fri, 31 Jul 2015 13:48:17 +0000
Message-Id: <E1ZLAfZ-0007c6-Ad@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bec4b89b02f0b28c43db102d83f11b2b2e61bb4
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Jul 29 16:32:48 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jul 29 16:32:48 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index effc470..e9a7097 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 ?= 3e2e51ecc1120bd59537ed19b6bc7066511c7e2e
-# Sun May 24 10:53:44 2015 +0200
-# pcnet: force the buffer access to be in bounds during tx
+QEMU_TRADITIONAL_REVISION ?= 7f057440b31da38196e3398fd1b618fc36ad97d6
+# Wed Jun 3 14:41:27 2015 +0200
+# ide: Clear DRQ after handling all expected accesses
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:48:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfm-0008LL-CF; Fri, 31 Jul 2015 13:48:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfl-0008L8-Jm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:29 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	F5/71-31450-CAC7BB55; Fri, 31 Jul 2015 13:48:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1438350507!19700257!1
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 32490 invoked from network); 31 Jul 2015 13:48:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:48:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfj-0004hk-Gk
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfj-0007eE-FX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:27 +0000
Date: Fri, 31 Jul 2015 13:48:27 +0000
Message-Id: <E1ZLAfj-0007eE-FX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m.c: fix missed off-by-one in
	altp2m commit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32524961873fd9dda50a71d46cd2d74ddbd8035a
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Wed Jul 29 09:40:06 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 10:00:28 2015 +0100

    x86/p2m.c: fix missed off-by-one in altp2m commit
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ff8be31..667b4c2 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2076,7 +2076,7 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
     struct domain *d = v->domain;
     bool_t rc = 0;
 
-    if ( idx > MAX_ALTP2M )
+    if ( idx >= MAX_ALTP2M )
         return rc;
 
     altp2m_list_lock(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 Jul 31 13:48:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfm-0008LL-CF; Fri, 31 Jul 2015 13:48:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfl-0008L8-Jm
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:29 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	F5/71-31450-CAC7BB55; Fri, 31 Jul 2015 13:48:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1438350507!19700257!1
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 32490 invoked from network); 31 Jul 2015 13:48:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:48:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfj-0004hk-Gk
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAfj-0007eE-FX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:27 +0000
Date: Fri, 31 Jul 2015 13:48:27 +0000
Message-Id: <E1ZLAfj-0007eE-FX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m.c: fix missed off-by-one in
	altp2m commit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32524961873fd9dda50a71d46cd2d74ddbd8035a
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Wed Jul 29 09:40:06 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 10:00:28 2015 +0100

    x86/p2m.c: fix missed off-by-one in altp2m commit
    
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ff8be31..667b4c2 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2076,7 +2076,7 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
     struct domain *d = v->domain;
     bool_t rc = 0;
 
-    if ( idx > MAX_ALTP2M )
+    if ( idx >= MAX_ALTP2M )
         return rc;
 
     altp2m_list_lock(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 Jul 31 13:48:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfx-0008NH-Ev; Fri, 31 Jul 2015 13:48: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 1ZLAfw-0008Mx-98
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:40 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	56/62-05427-7BC7BB55; Fri, 31 Jul 2015 13:48:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1438350517!36892022!1
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 17438 invoked from network); 31 Jul 2015 13:48:38 -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;
	31 Jul 2015 13:48:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAft-0004i0-MJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAft-0007fJ-L5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:37 +0000
Date: Fri, 31 Jul 2015 13:48:37 +0000
Message-Id: <E1ZLAft-0007fJ-L5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm.c: Don't tear down altp2m
	state if it was never set up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 211ce257be739447f85f17dec3a2ac604d1c8442
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Wed Jul 29 09:39:22 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 10:12:11 2015 +0100

    x86/hvm.c: Don't tear down altp2m state if it was never set up
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- replacement subject from Andy ]
---
 xen/arch/x86/hvm/hvm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ec1d797..6a56216 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2463,7 +2463,9 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     hvm_all_ioreq_servers_remove_vcpu(v->domain, v);
 
-    altp2m_vcpu_destroy(v);
+    if ( hvm_altp2m_supported() )
+        altp2m_vcpu_destroy(v);
+
     nestedhvm_vcpu_destroy(v);
 
     free_compat_arg_xlat(v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:48:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAfx-0008NH-Ev; Fri, 31 Jul 2015 13:48: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 1ZLAfw-0008Mx-98
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:40 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	56/62-05427-7BC7BB55; Fri, 31 Jul 2015 13:48:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1438350517!36892022!1
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 17438 invoked from network); 31 Jul 2015 13:48:38 -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;
	31 Jul 2015 13:48:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAft-0004i0-MJ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAft-0007fJ-L5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:37 +0000
Date: Fri, 31 Jul 2015 13:48:37 +0000
Message-Id: <E1ZLAft-0007fJ-L5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm.c: Don't tear down altp2m
	state if it was never set up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 211ce257be739447f85f17dec3a2ac604d1c8442
Author:     Ravi Sahita <ravi.sahita@intel.com>
AuthorDate: Wed Jul 29 09:39:22 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 10:12:11 2015 +0100

    x86/hvm.c: Don't tear down altp2m state if it was never set up
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Ravi Sahita <ravi.sahita@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- replacement subject from Andy ]
---
 xen/arch/x86/hvm/hvm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ec1d797..6a56216 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2463,7 +2463,9 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     hvm_all_ioreq_servers_remove_vcpu(v->domain, v);
 
-    altp2m_vcpu_destroy(v);
+    if ( hvm_altp2m_supported() )
+        altp2m_vcpu_destroy(v);
+
     nestedhvm_vcpu_destroy(v);
 
     free_compat_arg_xlat(v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:48:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAg7-0008Or-Ho; Fri, 31 Jul 2015 13:48:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg6-0008Oe-Fl
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:50 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	A6/CD-25435-1CC7BB55; Fri, 31 Jul 2015 13:48:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438350528!36867522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30176 invoked from network); 31 Jul 2015 13:48:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:48:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg3-0004i8-S4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg3-0007fj-QX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:47 +0000
Date: Fri, 31 Jul 2015 13:48:47 +0000
Message-Id: <E1ZLAg3-0007fj-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: use correct qemu path in
	systemd service file and init script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62fe12e12ed0e96f8eca00c535f87fb79fc5ccc0
Author:     Ting-Wei Lan <lantw44@gmail.com>
AuthorDate: Thu Jul 30 14:51:10 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 15:30:07 2015 +0100

    build: use correct qemu path in systemd service file and init script
    
    When --with-system-qemu is used, it is possible that we cannot find
    qemu-system-i386 in LIBEXEC_BIN, which can cause error in xencommons
    init script and xen-qemu-dom0-disk-backend.service systemd service.
    
    Signed-off-by: Ting-Wei Lan <lantw44@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/configure                                    |   21 +++++++++++++++----
 tools/configure.ac                                 |   19 +++++++++++++----
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in |    2 +-
 tools/hotplug/Linux/init.d/xencommons.in           |    2 +-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 tools/libxl/libxl_dm.c                             |    4 ---
 6 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/tools/configure b/tools/configure
index d90db47..cae0ea0 100755
--- a/tools/configure
+++ b/tools/configure
@@ -700,6 +700,8 @@ PREPEND_INCLUDES
 EXTRA_QEMUU_CONFIGURE_ARGS
 ovmf_path
 seabios_path
+qemu_xen_systemd
+qemu_xen_path
 qemu_xen
 rombios
 qemu_traditional
@@ -4264,9 +4266,14 @@ fi
 if test "${with_system_qemu+set}" = set; then :
   withval=$with_system_qemu;
     case $withval in
-    yes) qemu_xen=n ; qemu_xen_path=qemu ;;
-    no)  qemu_xen=y ; qemu_xen_path= ;;
-    *)   qemu_xen=n ; qemu_xen_path=$withval ;;
+        yes)
+            qemu_xen=n ; qemu_xen_path="qemu"
+            qemu_xen_systemd="/usr/bin/env $qemu_xen_path" ;;
+        no)
+            qemu_xen=y ;;
+        *)
+            qemu_xen=n ; qemu_xen_path="$withval" ;
+            qemu_xen_systemd="$qemu_xen_path" ;;
     esac
 
 else
@@ -4281,15 +4288,19 @@ else
 
 fi
 
-if test "x$qemu_xen" = "xn"; then :
+if test "x$qemu_xen" = "xy"; then :
+
+    qemu_xen_path="$LIBEXEC_BIN/qemu-system-i386"
+    qemu_xen_systemd="$qemu_xen_path"
 
+fi
 
 cat >>confdefs.h <<_ACEOF
 #define QEMU_XEN_PATH "$qemu_xen_path"
 _ACEOF
 
 
-fi
+
 
 
 
diff --git a/tools/configure.ac b/tools/configure.ac
index f6a79c2..c1fa658 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -176,9 +176,14 @@ AC_ARG_WITH([system-qemu],
        [Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen
         device model instead of building and installing our own version]),[
     case $withval in
-    yes) qemu_xen=n ; qemu_xen_path=qemu ;;
-    no)  qemu_xen=y ; qemu_xen_path= ;;
-    *)   qemu_xen=n ; qemu_xen_path=$withval ;;
+        yes)
+            qemu_xen=n ; qemu_xen_path="qemu"
+            qemu_xen_systemd="/usr/bin/env $qemu_xen_path" ;;
+        no)
+            qemu_xen=y ;;
+        *)
+            qemu_xen=n ; qemu_xen_path="$withval" ;
+            qemu_xen_systemd="$qemu_xen_path" ;;
     esac
 ],[
     case "$host_cpu" in
@@ -189,10 +194,14 @@ AC_ARG_WITH([system-qemu],
         *) qemu_xen=n;;
     esac
 ])
-AS_IF([test "x$qemu_xen" = "xn"], [
-    AC_DEFINE_UNQUOTED([QEMU_XEN_PATH], ["$qemu_xen_path"], [Qemu Xen path])
+AS_IF([test "x$qemu_xen" = "xy"], [
+    qemu_xen_path="$LIBEXEC_BIN/qemu-system-i386"
+    qemu_xen_systemd="$qemu_xen_path"
 ])
+AC_DEFINE_UNQUOTED([QEMU_XEN_PATH], ["$qemu_xen_path"], [Qemu Xen path])
 AC_SUBST(qemu_xen)
+AC_SUBST(qemu_xen_path)
+AC_SUBST(qemu_xen_systemd)
 
 AC_ARG_WITH([system-seabios],
     AS_HELP_STRING([--with-system-seabios@<:@=PATH@:>@],
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index f0fa98d..acc7309 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -47,4 +47,4 @@ XENSTORED_ARGS=
 #XENBACKENDD_DEBUG=[yes|on|1]
 
 # qemu path
-#QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386
+#QEMU_XEN=@qemu_xen_path@
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 00d0f55..21e9133 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -98,7 +98,7 @@ do_start () {
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
 	${sbindir}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
-	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
+	test -z "$QEMU_XEN" && QEMU_XEN="@qemu_xen_path@"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
 		-monitor /dev/null -serial /dev/null -parallel /dev/null \
 		-pidfile $QEMU_PIDFILE
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 274cec0..acf61a8 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -11,7 +11,7 @@ Type=simple
 PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
-ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \
+ExecStart=@qemu_xen_systemd@ -xen-domid 0 \
 	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
 	-monitor /dev/null -serial /dev/null -parallel /dev/null \
 	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8ac007a..02c0162 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -36,11 +36,7 @@ const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid)
 
 static const char *qemu_xen_path(libxl__gc *gc)
 {
-#ifdef QEMU_XEN_PATH
     return QEMU_XEN_PATH;
-#else
-    return libxl__abs_path(gc, "qemu-system-i386", libxl__private_bindir_path());
-#endif
 }
 
 static int libxl__create_qemu_logfile(libxl__gc *gc, char *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 Fri Jul 31 13:48:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:48: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 1ZLAg7-0008Or-Ho; Fri, 31 Jul 2015 13:48:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg6-0008Oe-Fl
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:50 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	A6/CD-25435-1CC7BB55; Fri, 31 Jul 2015 13:48:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1438350528!36867522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30176 invoked from network); 31 Jul 2015 13:48:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jul 2015 13:48:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg3-0004i8-S4
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAg3-0007fj-QX
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:47 +0000
Date: Fri, 31 Jul 2015 13:48:47 +0000
Message-Id: <E1ZLAg3-0007fj-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: use correct qemu path in
	systemd service file and init script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62fe12e12ed0e96f8eca00c535f87fb79fc5ccc0
Author:     Ting-Wei Lan <lantw44@gmail.com>
AuthorDate: Thu Jul 30 14:51:10 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 15:30:07 2015 +0100

    build: use correct qemu path in systemd service file and init script
    
    When --with-system-qemu is used, it is possible that we cannot find
    qemu-system-i386 in LIBEXEC_BIN, which can cause error in xencommons
    init script and xen-qemu-dom0-disk-backend.service systemd service.
    
    Signed-off-by: Ting-Wei Lan <lantw44@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/configure                                    |   21 +++++++++++++++----
 tools/configure.ac                                 |   19 +++++++++++++----
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in |    2 +-
 tools/hotplug/Linux/init.d/xencommons.in           |    2 +-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 tools/libxl/libxl_dm.c                             |    4 ---
 6 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/tools/configure b/tools/configure
index d90db47..cae0ea0 100755
--- a/tools/configure
+++ b/tools/configure
@@ -700,6 +700,8 @@ PREPEND_INCLUDES
 EXTRA_QEMUU_CONFIGURE_ARGS
 ovmf_path
 seabios_path
+qemu_xen_systemd
+qemu_xen_path
 qemu_xen
 rombios
 qemu_traditional
@@ -4264,9 +4266,14 @@ fi
 if test "${with_system_qemu+set}" = set; then :
   withval=$with_system_qemu;
     case $withval in
-    yes) qemu_xen=n ; qemu_xen_path=qemu ;;
-    no)  qemu_xen=y ; qemu_xen_path= ;;
-    *)   qemu_xen=n ; qemu_xen_path=$withval ;;
+        yes)
+            qemu_xen=n ; qemu_xen_path="qemu"
+            qemu_xen_systemd="/usr/bin/env $qemu_xen_path" ;;
+        no)
+            qemu_xen=y ;;
+        *)
+            qemu_xen=n ; qemu_xen_path="$withval" ;
+            qemu_xen_systemd="$qemu_xen_path" ;;
     esac
 
 else
@@ -4281,15 +4288,19 @@ else
 
 fi
 
-if test "x$qemu_xen" = "xn"; then :
+if test "x$qemu_xen" = "xy"; then :
+
+    qemu_xen_path="$LIBEXEC_BIN/qemu-system-i386"
+    qemu_xen_systemd="$qemu_xen_path"
 
+fi
 
 cat >>confdefs.h <<_ACEOF
 #define QEMU_XEN_PATH "$qemu_xen_path"
 _ACEOF
 
 
-fi
+
 
 
 
diff --git a/tools/configure.ac b/tools/configure.ac
index f6a79c2..c1fa658 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -176,9 +176,14 @@ AC_ARG_WITH([system-qemu],
        [Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen
         device model instead of building and installing our own version]),[
     case $withval in
-    yes) qemu_xen=n ; qemu_xen_path=qemu ;;
-    no)  qemu_xen=y ; qemu_xen_path= ;;
-    *)   qemu_xen=n ; qemu_xen_path=$withval ;;
+        yes)
+            qemu_xen=n ; qemu_xen_path="qemu"
+            qemu_xen_systemd="/usr/bin/env $qemu_xen_path" ;;
+        no)
+            qemu_xen=y ;;
+        *)
+            qemu_xen=n ; qemu_xen_path="$withval" ;
+            qemu_xen_systemd="$qemu_xen_path" ;;
     esac
 ],[
     case "$host_cpu" in
@@ -189,10 +194,14 @@ AC_ARG_WITH([system-qemu],
         *) qemu_xen=n;;
     esac
 ])
-AS_IF([test "x$qemu_xen" = "xn"], [
-    AC_DEFINE_UNQUOTED([QEMU_XEN_PATH], ["$qemu_xen_path"], [Qemu Xen path])
+AS_IF([test "x$qemu_xen" = "xy"], [
+    qemu_xen_path="$LIBEXEC_BIN/qemu-system-i386"
+    qemu_xen_systemd="$qemu_xen_path"
 ])
+AC_DEFINE_UNQUOTED([QEMU_XEN_PATH], ["$qemu_xen_path"], [Qemu Xen path])
 AC_SUBST(qemu_xen)
+AC_SUBST(qemu_xen_path)
+AC_SUBST(qemu_xen_systemd)
 
 AC_ARG_WITH([system-seabios],
     AS_HELP_STRING([--with-system-seabios@<:@=PATH@:>@],
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index f0fa98d..acc7309 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -47,4 +47,4 @@ XENSTORED_ARGS=
 #XENBACKENDD_DEBUG=[yes|on|1]
 
 # qemu path
-#QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386
+#QEMU_XEN=@qemu_xen_path@
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 00d0f55..21e9133 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -98,7 +98,7 @@ do_start () {
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
 	${sbindir}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
-	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
+	test -z "$QEMU_XEN" && QEMU_XEN="@qemu_xen_path@"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
 		-monitor /dev/null -serial /dev/null -parallel /dev/null \
 		-pidfile $QEMU_PIDFILE
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 274cec0..acf61a8 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -11,7 +11,7 @@ Type=simple
 PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
-ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \
+ExecStart=@qemu_xen_systemd@ -xen-domid 0 \
 	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
 	-monitor /dev/null -serial /dev/null -parallel /dev/null \
 	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8ac007a..02c0162 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -36,11 +36,7 @@ const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid)
 
 static const char *qemu_xen_path(libxl__gc *gc)
 {
-#ifdef QEMU_XEN_PATH
     return QEMU_XEN_PATH;
-#else
-    return libxl__abs_path(gc, "qemu-system-i386", libxl__private_bindir_path());
-#endif
 }
 
 static int libxl__create_qemu_logfile(libxl__gc *gc, char *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 Fri Jul 31 13:49:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgI-0008QX-KP; Fri, 31 Jul 2015 13:49:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgH-0008QL-F5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:01 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	63/E1-00475-CCC7BB55; Fri, 31 Jul 2015 13:49:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1438350539!36840651!1
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 23359 invoked from network); 31 Jul 2015 13:48:59 -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;
	31 Jul 2015 13:48:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgE-0004iG-TG
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgE-0007gS-Qq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:58 +0000
Date: Fri, 31 Jul 2015 13:48:58 +0000
Message-Id: <E1ZLAgE-0007gS-Qq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Replace FSF street address
	with canonical URL in patches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fec8577da93f1670103cf07d5e22828d35770bd3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 29 10:09:47 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 11:02:25 2015 +0100

    stubdom: Replace FSF street address with canonical URL in patches
    
    Do these ones manually since the diff header needs fixup too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/grub.patches/10graphics.diff |   10 ++++------
 stubdom/grub.patches/61btrfs.diff    |    6 ++----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
index d891c51..5ee2852 100644
--- a/stubdom/grub.patches/10graphics.diff
+++ b/stubdom/grub.patches/10graphics.diff
@@ -1164,7 +1164,7 @@ diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
 diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 --- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
 +++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,585 @@
+@@ -0,0 +1,584 @@
 +/*
 + * graphics.c - graphics mode support for GRUB
 + * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
@@ -1187,8 +1187,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +#ifdef SUPPORT_GRAPHICS
@@ -1753,7 +1752,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
 --- grub-0.97.orig/stage2/graphics.h	1969-12-31 21:00:00.000000000 -0300
 +++ grub-0.97/stage2/graphics.h	2005-06-12 20:56:49.000000000 -0300
-@@ -0,0 +1,44 @@
+@@ -0,0 +1,43 @@
 +/* graphics.h - graphics console interface */
 +/*
 + *  GRUB  --  GRand Unified Bootloader
@@ -1770,8 +1769,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +#ifndef GRAPHICS_H
diff --git a/stubdom/grub.patches/61btrfs.diff b/stubdom/grub.patches/61btrfs.diff
index fc72771..c831a10 100644
--- a/stubdom/grub.patches/61btrfs.diff
+++ b/stubdom/grub.patches/61btrfs.diff
@@ -66,7 +66,7 @@ diff -up grub-upstream.wip/INSTALL.btrfs grub-upstream.wip/INSTALL
 diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
 --- /dev/null	2009-06-03 06:46:26.160951000 +0000
 +++ grub-upstream.wip/stage2/btrfs.h	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1415 @@
+@@ -0,0 +1,1413 @@
 +/* btrfs.h - an extraction from btrfs-progs-0.18/ctree.h into one file
 + *
 + * Copyright (C) 2007 Oracle.  All rights reserved.
@@ -81,9 +81,7 @@ diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
 + * General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public
-+ * License along with this program; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 021110-1307, USA.
++ * License along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +/* include/asm-i386/types.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 Fri Jul 31 13:49:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgI-0008QX-KP; Fri, 31 Jul 2015 13:49:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgH-0008QL-F5
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:01 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	63/E1-00475-CCC7BB55; Fri, 31 Jul 2015 13:49:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1438350539!36840651!1
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 23359 invoked from network); 31 Jul 2015 13:48:59 -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;
	31 Jul 2015 13:48:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgE-0004iG-TG
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgE-0007gS-Qq
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:48:58 +0000
Date: Fri, 31 Jul 2015 13:48:58 +0000
Message-Id: <E1ZLAgE-0007gS-Qq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Replace FSF street address
	with canonical URL in patches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fec8577da93f1670103cf07d5e22828d35770bd3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 29 10:09:47 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 11:02:25 2015 +0100

    stubdom: Replace FSF street address with canonical URL in patches
    
    Do these ones manually since the diff header needs fixup too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/grub.patches/10graphics.diff |   10 ++++------
 stubdom/grub.patches/61btrfs.diff    |    6 ++----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
index d891c51..5ee2852 100644
--- a/stubdom/grub.patches/10graphics.diff
+++ b/stubdom/grub.patches/10graphics.diff
@@ -1164,7 +1164,7 @@ diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
 diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 --- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
 +++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,585 @@
+@@ -0,0 +1,584 @@
 +/*
 + * graphics.c - graphics mode support for GRUB
 + * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
@@ -1187,8 +1187,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +#ifdef SUPPORT_GRAPHICS
@@ -1753,7 +1752,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
 diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
 --- grub-0.97.orig/stage2/graphics.h	1969-12-31 21:00:00.000000000 -0300
 +++ grub-0.97/stage2/graphics.h	2005-06-12 20:56:49.000000000 -0300
-@@ -0,0 +1,44 @@
+@@ -0,0 +1,43 @@
 +/* graphics.h - graphics console interface */
 +/*
 + *  GRUB  --  GRand Unified Bootloader
@@ -1770,8 +1769,7 @@ diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +#ifndef GRAPHICS_H
diff --git a/stubdom/grub.patches/61btrfs.diff b/stubdom/grub.patches/61btrfs.diff
index fc72771..c831a10 100644
--- a/stubdom/grub.patches/61btrfs.diff
+++ b/stubdom/grub.patches/61btrfs.diff
@@ -66,7 +66,7 @@ diff -up grub-upstream.wip/INSTALL.btrfs grub-upstream.wip/INSTALL
 diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
 --- /dev/null	2009-06-03 06:46:26.160951000 +0000
 +++ grub-upstream.wip/stage2/btrfs.h	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1415 @@
+@@ -0,0 +1,1413 @@
 +/* btrfs.h - an extraction from btrfs-progs-0.18/ctree.h into one file
 + *
 + * Copyright (C) 2007 Oracle.  All rights reserved.
@@ -81,9 +81,7 @@ diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
 + * General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public
-+ * License along with this program; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 021110-1307, USA.
++ * License along with this program; If not, see <http://www.gnu.org/licenses/>
 + */
 +
 +/* include/asm-i386/types.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 Fri Jul 31 13:49:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgX-0008Sp-PV; Fri, 31 Jul 2015 13:49:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgW-0008SX-Cg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:16 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	A2/A2-12889-BDC7BB55; Fri, 31 Jul 2015 13:49:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1438350549!36943738!1
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 28088 invoked from network); 31 Jul 2015 13:49:10 -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;
	31 Jul 2015 13:49:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgP-0004ir-IC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgP-0007hA-FR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:09 +0000
Date: Fri, 31 Jul 2015 13:49:09 +0000
Message-Id: <E1ZLAgP-0007hA-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Replace FSF street address with
	canonical URL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 443701ef0c7ff30872e27419cf4356fb6bdb4059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 29 11:00:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 11:14:07 2015 +0100

    Replace FSF street address with canonical URL
    
    As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.
    
    This is the result of:
    $ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl
    
    Where fsf.pl is:
        #!/usr/bin/perl -w -pi.bak -0777
        my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
        my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;
    
        my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;
    
        my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
        my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
        my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;
    
        s|$inwt$br$mass|$repl|m;
        s|$inwt$br$franklin|$repl|m;
        s|$inwt$br$temple|$repl|m;
    
    The only remaining mentions of these addresses are in COPYING files which I
    haven't touched.
    
    Some of the changed files are imports from elsewhere, however
    filtering them out is tricky, I think it is tolerable to have these
    files be modified here and then perhaps reverted on the next sync,
    since it's only 1-2 lines and obvious what is going on.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 COPYING                                            |    3 +--
 m4/pkg.m4                                          |    3 +--
 m4/systemd.m4                                      |    3 +--
 stubdom/vtpmmgr/tpmrsa.c                           |    3 +--
 stubdom/vtpmmgr/tpmrsa.h                           |    3 +--
 tools/blktap2/drivers/libaio-compat.h              |    4 +---
 tools/configure                                    |    6 ++----
 tools/console/client/main.c                        |    3 +--
 tools/console/daemon/io.c                          |    3 +--
 tools/console/daemon/io.h                          |    3 +--
 tools/console/daemon/main.c                        |    3 +--
 tools/console/daemon/utils.c                       |    3 +--
 tools/console/daemon/utils.h                       |    3 +--
 tools/debugger/gdbsx/gx/gx.h                       |    4 +---
 tools/debugger/gdbsx/gx/gx_comm.c                  |    8 ++------
 tools/debugger/gdbsx/gx/gx_local.c                 |    4 +---
 tools/debugger/gdbsx/gx/gx_main.c                  |    4 +---
 tools/debugger/gdbsx/gx/gx_utils.c                 |    4 +---
 tools/debugger/gdbsx/gx/xg_dummy.c                 |    4 +---
 tools/debugger/gdbsx/xg/xg_main.c                  |    4 +---
 tools/debugger/gdbsx/xg/xg_public.h                |    4 +---
 tools/firmware/hvmloader/32bitbios_support.c       |    3 +--
 tools/firmware/hvmloader/Makefile                  |    3 +--
 tools/firmware/hvmloader/acpi/Makefile             |    3 +--
 tools/firmware/hvmloader/acpi/acpi2_0.h            |    3 +--
 tools/firmware/hvmloader/acpi/build.c              |    3 +--
 tools/firmware/hvmloader/acpi/dsdt.asl             |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_pm.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s3.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s4.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_tpm.asl         |    3 +--
 tools/firmware/hvmloader/acpi/static_tables.c      |    3 +--
 tools/firmware/hvmloader/cacheattr.c               |    3 +--
 tools/firmware/hvmloader/e820.c                    |    3 +--
 tools/firmware/hvmloader/hvmloader.c               |    3 +--
 tools/firmware/hvmloader/mkhex                     |    3 +--
 tools/firmware/hvmloader/mp_tables.c               |    3 +--
 tools/firmware/hvmloader/optionroms.c              |    3 +--
 tools/firmware/hvmloader/ovmf.c                    |    3 +--
 tools/firmware/hvmloader/pci.c                     |    3 +--
 tools/firmware/hvmloader/pir_types.h               |    3 +--
 tools/firmware/hvmloader/rombios.c                 |    3 +--
 tools/firmware/hvmloader/seabios.c                 |    3 +--
 tools/firmware/hvmloader/smbios.c                  |    3 +--
 tools/firmware/hvmloader/smbios_types.h            |    3 +--
 tools/firmware/hvmloader/smp.c                     |    3 +--
 tools/firmware/hvmloader/tests.c                   |    3 +--
 tools/firmware/hvmloader/util.c                    |    3 +--
 tools/firmware/rombios/32bit/32bitbios.c           |    3 +--
 tools/firmware/rombios/32bit/mkhex                 |    3 +--
 tools/firmware/rombios/32bit/pmm.c                 |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c     |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c |    3 +--
 tools/firmware/rombios/32bit/util.c                |    3 +--
 tools/firmware/rombios/32bitgateway.c              |    3 +--
 tools/firmware/rombios/apmbios.S                   |    3 +--
 tools/firmware/rombios/rombios.c                   |    3 +--
 tools/firmware/rombios/rombios.h                   |    3 +--
 tools/firmware/rombios/tcgbios.c                   |    3 +--
 tools/firmware/vgabios/COPYING                     |    3 +--
 tools/firmware/vgabios/biossums.c                  |    3 +--
 tools/firmware/vgabios/clext.c                     |    3 +--
 tools/firmware/vgabios/vbe.c                       |    3 +--
 tools/firmware/vgabios/vgabios.c                   |    3 +--
 tools/hotplug/Linux/block-common.sh                |    3 +--
 tools/hotplug/Linux/block-drbd-probe               |    3 +--
 tools/hotplug/Linux/external-device-migrate        |    3 +--
 tools/hotplug/Linux/locking.sh                     |    3 +--
 tools/hotplug/Linux/logging.sh                     |    3 +--
 tools/hotplug/Linux/vif-common.sh                  |    3 +--
 tools/hotplug/Linux/xen-hotplug-common.sh.in       |    3 +--
 tools/hotplug/Linux/xen-network-common.sh          |    3 +--
 tools/hotplug/Linux/xen-script-common.sh           |    3 +--
 tools/libfsimage/ext2fs/fsys_ext2fs.c              |    3 +--
 tools/libfsimage/fat/fat.h                         |    3 +--
 tools/libfsimage/fat/fsys_fat.c                    |    3 +--
 tools/libfsimage/iso9660/fsys_iso9660.c            |    3 +--
 tools/libfsimage/iso9660/iso9660.h                 |    3 +--
 tools/libfsimage/reiserfs/fsys_reiserfs.c          |    3 +--
 tools/libfsimage/ufs/fsys_ufs.c                    |    3 +--
 tools/libfsimage/xfs/fsys_xfs.c                    |    3 +--
 tools/libfsimage/xfs/xfs.h                         |    3 +--
 tools/libfsimage/zfs/Makefile                      |    3 +--
 tools/libfsimage/zfs/filesys.h                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.c                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.h                     |    3 +--
 tools/libfsimage/zfs/fsys_zfs.c                    |    3 +--
 tools/libfsimage/zfs/fsys_zfs.h                    |    3 +--
 tools/libfsimage/zfs/mb_info.h                     |    3 +--
 tools/libfsimage/zfs/shared.h                      |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu_objset.h      |    3 +--
 tools/libfsimage/zfs/zfs-include/dnode.h           |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dataset.h     |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dir.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/sa_impl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/spa.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/uberblock_impl.h  |    3 +--
 tools/libfsimage/zfs/zfs-include/vdev_impl.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_impl.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_leaf.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_acl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_znode.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zil.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio_checksum.h    |    3 +--
 tools/libfsimage/zfs/zfs_fletcher.c                |    3 +--
 tools/libfsimage/zfs/zfs_lzjb.c                    |    3 +--
 tools/libfsimage/zfs/zfs_sha256.c                  |    3 +--
 tools/libvchan/init.c                              |    3 +--
 tools/libvchan/io.c                                |    3 +--
 tools/libvchan/libxenvchan.h                       |    3 +--
 tools/libvchan/node-select.c                       |    3 +--
 tools/libvchan/node.c                              |    3 +--
 tools/libxc/include/xc_dom.h                       |    3 +--
 tools/libxc/include/xenctrl.h                      |    3 +--
 tools/libxc/include/xenctrlosdep.h                 |    3 +--
 tools/libxc/include/xenguest.h                     |    3 +--
 tools/libxc/include/xentoollog.h                   |    3 +--
 tools/libxc/xc_altp2m.c                            |    3 +--
 tools/libxc/xc_compression.c                       |    3 +--
 tools/libxc/xc_core.c                              |    3 +--
 tools/libxc/xc_core.h                              |    3 +--
 tools/libxc/xc_core_arm.c                          |    3 +--
 tools/libxc/xc_core_arm.h                          |    3 +--
 tools/libxc/xc_core_x86.c                          |    3 +--
 tools/libxc/xc_core_x86.h                          |    3 +--
 tools/libxc/xc_cpu_hotplug.c                       |    3 +--
 tools/libxc/xc_cpufeature.h                        |    3 +--
 tools/libxc/xc_cpuid_x86.c                         |    3 +--
 tools/libxc/xc_cpupool.c                           |    3 +--
 tools/libxc/xc_csched.c                            |    3 +--
 tools/libxc/xc_csched2.c                           |    3 +--
 tools/libxc/xc_dom_arm.c                           |    3 +--
 tools/libxc/xc_dom_armzimageloader.c               |    3 +--
 tools/libxc/xc_dom_binloader.c                     |    3 +--
 tools/libxc/xc_dom_boot.c                          |    3 +--
 tools/libxc/xc_dom_bzimageloader.c                 |    3 +--
 tools/libxc/xc_dom_compat_linux.c                  |    3 +--
 tools/libxc/xc_dom_core.c                          |    3 +--
 tools/libxc/xc_dom_elfloader.c                     |    3 +--
 tools/libxc/xc_dom_x86.c                           |    3 +--
 tools/libxc/xc_domain.c                            |    3 +--
 tools/libxc/xc_efi.h                               |    3 +--
 tools/libxc/xc_elf.h                               |    3 +--
 tools/libxc/xc_evtchn.c                            |    3 +--
 tools/libxc/xc_flask.c                             |    3 +--
 tools/libxc/xc_foreign_memory.c                    |    3 +--
 tools/libxc/xc_freebsd.c                           |    3 +--
 tools/libxc/xc_freebsd_osdep.c                     |    3 +--
 tools/libxc/xc_gnttab.c                            |    3 +--
 tools/libxc/xc_hcall_buf.c                         |    3 +--
 tools/libxc/xc_hvm_build_arm.c                     |    3 +--
 tools/libxc/xc_hvm_build_x86.c                     |    3 +--
 tools/libxc/xc_linux.c                             |    3 +--
 tools/libxc/xc_linux_osdep.c                       |    3 +--
 tools/libxc/xc_mem_access.c                        |    3 +--
 tools/libxc/xc_mem_paging.c                        |    3 +--
 tools/libxc/xc_memshr.c                            |    3 +--
 tools/libxc/xc_minios.c                            |    3 +--
 tools/libxc/xc_misc.c                              |    3 +--
 tools/libxc/xc_monitor.c                           |    3 +--
 tools/libxc/xc_netbsd.c                            |    3 +--
 tools/libxc/xc_nomigrate.c                         |    3 +--
 tools/libxc/xc_offline_page.c                      |    3 +--
 tools/libxc/xc_pagetab.c                           |    3 +--
 tools/libxc/xc_physdev.c                           |    3 +--
 tools/libxc/xc_pm.c                                |    3 +--
 tools/libxc/xc_private.c                           |    3 +--
 tools/libxc/xc_private.h                           |    3 +--
 tools/libxc/xc_resume.c                            |    3 +--
 tools/libxc/xc_rt.c                                |    3 +--
 tools/libxc/xc_solaris.c                           |    3 +--
 tools/libxc/xc_suspend.c                           |    3 +--
 tools/libxc/xc_tbuf.c                              |    3 +--
 tools/libxc/xc_tmem.c                              |    3 +--
 tools/libxc/xc_vm_event.c                          |    3 +--
 tools/libxc/xg_private.c                           |    3 +--
 tools/libxc/xg_private.h                           |    3 +--
 tools/libxc/xg_save_restore.h                      |    3 +--
 tools/libxc/xtl_core.c                             |    3 +--
 tools/libxc/xtl_logger_stdio.c                     |    3 +--
 tools/memshr/bidir-daemon.c                        |    3 +--
 tools/memshr/bidir-daemon.h                        |    3 +--
 tools/memshr/bidir-hash.c                          |    3 +--
 tools/memshr/bidir-hash.h                          |    3 +--
 tools/memshr/bidir-namedefs.h                      |    3 +--
 tools/memshr/interface.c                           |    3 +--
 tools/memshr/memshr-priv.h                         |    3 +--
 tools/memshr/memshr.h                              |    3 +--
 tools/memshr/shm.c                                 |    3 +--
 tools/memshr/shm.h                                 |    3 +--
 tools/misc/gtracestat.c                            |    3 +--
 tools/misc/gtraceview.c                            |    3 +--
 tools/misc/xen-ringwatch                           |    4 +---
 tools/misc/xencov.c                                |    3 +--
 tools/misc/xencov_split                            |    3 +--
 tools/misc/xenpm.c                                 |    3 +--
 tools/misc/xenpvnetboot                            |    4 +---
 tools/ocaml/LICENSE                                |    3 +--
 tools/pygrub/src/ExtLinuxConf.py                   |    3 +--
 tools/pygrub/src/GrubConf.py                       |    3 +--
 tools/pygrub/src/pygrub                            |    3 +--
 tools/python/xen/lowlevel/xl/xl.c                  |    3 +--
 tools/python/xen/lowlevel/xs/xs.c                  |    3 +--
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/config/setup.conf             |    3 +--
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        |    3 +--
 tools/tests/mce-test/tools/xen-mceinj.c            |    3 +--
 tools/tests/utests/run_all_tests.py                |    3 +--
 tools/tests/x86_emulator/blowfish.c                |    3 +--
 tools/xenbackendd/xenbackendd.c                    |    3 +--
 tools/xenmon/COPYING                               |    3 +--
 tools/xenmon/setmask.c                             |    3 +--
 tools/xenmon/xenbaked.c                            |    3 +--
 tools/xenmon/xenbaked.h                            |    3 +--
 tools/xenmon/xenmon.py                             |    3 +--
 tools/xenpaging/file_ops.c                         |    3 +--
 tools/xenpaging/file_ops.h                         |    3 +--
 tools/xenpaging/policy.h                           |    3 +--
 tools/xenpaging/policy_default.c                   |    3 +--
 tools/xenpaging/xenpaging.c                        |    3 +--
 tools/xenpaging/xenpaging.h                        |    3 +--
 tools/xenpmd/xenpmd.c                              |    3 +--
 tools/xenstat/libxenstat/COPYING                   |    3 +--
 tools/xenstat/xentop/xentop.1                      |    3 +--
 tools/xenstat/xentop/xentop.c                      |    3 +--
 tools/xenstore/COPYING                             |    3 +--
 tools/xenstore/include/xenstore.h                  |    3 +--
 tools/xenstore/include/xenstore_lib.h              |    3 +--
 tools/xenstore/talloc.c                            |    3 +--
 tools/xenstore/talloc.h                            |    3 +--
 tools/xenstore/tdb.c                               |    3 +--
 tools/xenstore/tdb.h                               |    3 +--
 tools/xenstore/xenstored_core.c                    |    3 +--
 tools/xenstore/xenstored_core.h                    |    3 +--
 tools/xenstore/xenstored_domain.c                  |    3 +--
 tools/xenstore/xenstored_domain.h                  |    3 +--
 tools/xenstore/xenstored_minios.c                  |    3 +--
 tools/xenstore/xenstored_posix.c                   |    3 +--
 tools/xenstore/xenstored_transaction.c             |    3 +--
 tools/xenstore/xenstored_transaction.h             |    3 +--
 tools/xenstore/xenstored_watch.c                   |    3 +--
 tools/xenstore/xenstored_watch.h                   |    3 +--
 tools/xenstore/xs.c                                |    3 +--
 tools/xenstore/xs_lib.c                            |    3 +--
 tools/xentrace/xenalyze.c                          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.c          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.h          |    3 +--
 .../linux-2.6/platform-pci/xen_support.c           |    3 +--
 xen/COPYING                                        |    3 +--
 xen/arch/arm/arm32/lib/lib1funcs.S                 |    4 +---
 xen/arch/arm/arm32/lib/lshrdi3.S                   |    4 +---
 xen/arch/x86/acpi/boot.c                           |    3 +--
 xen/arch/x86/acpi/cpu_idle.c                       |    3 +--
 xen/arch/x86/acpi/cpufreq/cpufreq.c                |    3 +--
 xen/arch/x86/acpi/cpufreq/powernow.c               |    3 +--
 xen/arch/x86/acpi/cpuidle_menu.c                   |    3 +--
 xen/arch/x86/acpi/lib.c                            |    3 +--
 xen/arch/x86/alternative.c                         |    3 +--
 xen/arch/x86/cpu/mcheck/amd_nonfatal.c             |    3 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c                 |    3 +--
 xen/arch/x86/cpu/mcheck/mce_amd.c                  |    3 +--
 xen/arch/x86/cpu/mcheck/mce_quirks.h               |    3 +--
 xen/arch/x86/cpu/mcheck/vmce.c                     |    3 +--
 xen/arch/x86/cpu/mcheck/x86_mca.h                  |    3 +--
 xen/arch/x86/cpu/mtrr/main.c                       |    3 +--
 xen/arch/x86/cpu/mwait-idle.c                      |    3 +--
 xen/arch/x86/cpu/vpmu.c                            |    3 +--
 xen/arch/x86/cpu/vpmu_amd.c                        |    3 +--
 xen/arch/x86/cpu/vpmu_intel.c                      |    3 +--
 xen/arch/x86/debug.c                               |    4 +---
 xen/arch/x86/gdbstub.c                             |    3 +--
 xen/arch/x86/genapic/x2apic.c                      |    3 +--
 xen/arch/x86/hvm/asid.c                            |    3 +--
 xen/arch/x86/hvm/event.c                           |    3 +--
 xen/arch/x86/hvm/hpet.c                            |    3 +--
 xen/arch/x86/hvm/hvm.c                             |    3 +--
 xen/arch/x86/hvm/intercept.c                       |    3 +--
 xen/arch/x86/hvm/io.c                              |    3 +--
 xen/arch/x86/hvm/irq.c                             |    3 +--
 xen/arch/x86/hvm/mtrr.c                            |    3 +--
 xen/arch/x86/hvm/nestedhvm.c                       |    3 +--
 xen/arch/x86/hvm/pmtimer.c                         |    3 +--
 xen/arch/x86/hvm/quirks.c                          |    3 +--
 xen/arch/x86/hvm/save.c                            |    3 +--
 xen/arch/x86/hvm/svm/asid.c                        |    3 +--
 xen/arch/x86/hvm/svm/emulate.c                     |    3 +--
 xen/arch/x86/hvm/svm/entry.S                       |    3 +--
 xen/arch/x86/hvm/svm/intr.c                        |    3 +--
 xen/arch/x86/hvm/svm/nestedsvm.c                   |    3 +--
 xen/arch/x86/hvm/svm/svm.c                         |    3 +--
 xen/arch/x86/hvm/svm/svmdebug.c                    |    3 +--
 xen/arch/x86/hvm/svm/vmcb.c                        |    3 +--
 xen/arch/x86/hvm/vioapic.c                         |    3 +--
 xen/arch/x86/hvm/vlapic.c                          |    3 +--
 xen/arch/x86/hvm/vmsi.c                            |    3 +--
 xen/arch/x86/hvm/vmx/entry.S                       |    3 +--
 xen/arch/x86/hvm/vmx/intr.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmcs.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmx.c                         |    3 +--
 xen/arch/x86/hvm/vmx/vvmx.c                        |    3 +--
 xen/arch/x86/hvm/vpt.c                             |    3 +--
 xen/arch/x86/mm.c                                  |    3 +--
 xen/arch/x86/mm/altp2m.c                           |    3 +--
 xen/arch/x86/mm/guest_walk.c                       |    3 +--
 xen/arch/x86/mm/hap/guest_walk.c                   |    3 +--
 xen/arch/x86/mm/hap/hap.c                          |    3 +--
 xen/arch/x86/mm/hap/nested_ept.c                   |    3 +--
 xen/arch/x86/mm/hap/nested_hap.c                   |    3 +--
 xen/arch/x86/mm/hap/private.h                      |    3 +--
 xen/arch/x86/mm/mem_paging.c                       |    3 +--
 xen/arch/x86/mm/mem_sharing.c                      |    3 +--
 xen/arch/x86/mm/mm-locks.h                         |    3 +--
 xen/arch/x86/mm/p2m-ept.c                          |    3 +--
 xen/arch/x86/mm/p2m-pod.c                          |    3 +--
 xen/arch/x86/mm/p2m-pt.c                           |    3 +--
 xen/arch/x86/mm/p2m.c                              |    3 +--
 xen/arch/x86/mm/paging.c                           |    3 +--
 xen/arch/x86/mm/shadow/common.c                    |    3 +--
 xen/arch/x86/mm/shadow/multi.c                     |    3 +--
 xen/arch/x86/mm/shadow/multi.h                     |    3 +--
 xen/arch/x86/mm/shadow/private.h                   |    3 +--
 xen/arch/x86/mm/shadow/types.h                     |    3 +--
 xen/arch/x86/monitor.c                             |    4 +---
 xen/arch/x86/smpboot.c                             |    3 +--
 xen/arch/x86/traps.c                               |    3 +--
 xen/arch/x86/vm_event.c                            |    4 +---
 xen/arch/x86/x86_64/acpi_mmcfg.c                   |    3 +--
 xen/arch/x86/x86_64/cpu_idle.c                     |    3 +--
 xen/arch/x86/x86_64/cpufreq.c                      |    3 +--
 xen/arch/x86/x86_64/gdbstub.c                      |    3 +--
 xen/arch/x86/x86_64/mm.c                           |    3 +--
 xen/arch/x86/x86_64/mmconfig.h                     |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.c             |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.h             |    3 +--
 xen/common/event_channel.c                         |    3 +--
 xen/common/gdbstub.c                               |    3 +--
 xen/common/grant_table.c                           |    3 +--
 xen/common/hvm/save.c                              |    3 +--
 xen/common/libelf/libelf-dominfo.c                 |    3 +--
 xen/common/libelf/libelf-loader.c                  |    3 +--
 xen/common/libelf/libelf-private.h                 |    3 +--
 xen/common/libelf/libelf-tools.c                   |    3 +--
 xen/common/libfdt/fdt.c                            |    4 +---
 xen/common/libfdt/fdt_empty_tree.c                 |    4 +---
 xen/common/libfdt/fdt_ro.c                         |    4 +---
 xen/common/libfdt/fdt_rw.c                         |    4 +---
 xen/common/libfdt/fdt_strerror.c                   |    4 +---
 xen/common/libfdt/fdt_sw.c                         |    4 +---
 xen/common/libfdt/fdt_wip.c                        |    4 +---
 xen/common/libfdt/libfdt_internal.h                |    4 +---
 xen/common/mem_access.c                            |    3 +--
 xen/common/page_alloc.c                            |    3 +--
 xen/common/pdx.c                                   |    3 +--
 xen/common/preempt.c                               |    3 +--
 xen/common/radix-tree.c                            |    3 +--
 xen/common/rbtree.c                                |    3 +--
 xen/common/rcupdate.c                              |    3 +--
 xen/common/stop_machine.c                          |    3 +--
 xen/common/time.c                                  |    3 +--
 xen/common/unlzma.c                                |    3 +--
 xen/common/unlzo.c                                 |    3 +--
 xen/common/vm_event.c                              |    3 +--
 xen/common/wait.c                                  |    3 +--
 xen/drivers/acpi/apei/apei-base.c                  |    3 +--
 xen/drivers/acpi/apei/apei-io.c                    |    3 +--
 xen/drivers/acpi/apei/erst.c                       |    3 +--
 xen/drivers/acpi/apei/hest.c                       |    3 +--
 xen/drivers/acpi/numa.c                            |    3 +--
 xen/drivers/acpi/osl.c                             |    3 +--
 xen/drivers/acpi/pmstat.c                          |    3 +--
 xen/drivers/acpi/tables.c                          |    3 +--
 xen/drivers/cpufreq/cpufreq.c                      |    3 +--
 xen/drivers/passthrough/amd/iommu_acpi.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_cmd.c            |    3 +--
 xen/drivers/passthrough/amd/iommu_detect.c         |    3 +--
 xen/drivers/passthrough/amd/iommu_guest.c          |    3 +--
 xen/drivers/passthrough/amd/iommu_init.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_intr.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_map.c            |    3 +--
 xen/drivers/passthrough/amd/pci_amd_iommu.c        |    3 +--
 xen/drivers/passthrough/arm/smmu.c                 |    3 +--
 xen/drivers/passthrough/ats.h                      |    3 +--
 xen/drivers/passthrough/io.c                       |    3 +--
 xen/drivers/passthrough/iommu.c                    |    3 +--
 xen/drivers/passthrough/pci.c                      |    3 +--
 xen/drivers/passthrough/vtd/dmar.c                 |    3 +--
 xen/drivers/passthrough/vtd/dmar.h                 |    3 +--
 xen/drivers/passthrough/vtd/extern.h               |    3 +--
 xen/drivers/passthrough/vtd/intremap.c             |    3 +--
 xen/drivers/passthrough/vtd/iommu.c                |    3 +--
 xen/drivers/passthrough/vtd/iommu.h                |    3 +--
 xen/drivers/passthrough/vtd/qinval.c               |    3 +--
 xen/drivers/passthrough/vtd/quirks.c               |    3 +--
 xen/drivers/passthrough/vtd/utils.c                |    3 +--
 xen/drivers/passthrough/vtd/vtd.h                  |    3 +--
 xen/drivers/passthrough/vtd/x86/ats.c              |    3 +--
 xen/drivers/passthrough/vtd/x86/vtd.c              |    3 +--
 xen/drivers/passthrough/x86/ats.c                  |    3 +--
 xen/drivers/passthrough/x86/iommu.c                |    3 +--
 xen/include/asm-arm/iommu.h                        |    3 +--
 xen/include/asm-arm/monitor.h                      |    4 +---
 xen/include/asm-arm/vm_event.h                     |    3 +--
 xen/include/asm-x86/acpi.h                         |    3 +--
 xen/include/asm-x86/altp2m.h                       |    3 +--
 xen/include/asm-x86/amd-iommu.h                    |    3 +--
 xen/include/asm-x86/guest_pt.h                     |    3 +--
 xen/include/asm-x86/hap.h                          |    3 +--
 xen/include/asm-x86/hvm/asid.h                     |    3 +--
 xen/include/asm-x86/hvm/domain.h                   |    3 +--
 xen/include/asm-x86/hvm/event.h                    |    3 +--
 xen/include/asm-x86/hvm/hvm.h                      |    3 +--
 xen/include/asm-x86/hvm/io.h                       |    3 +--
 xen/include/asm-x86/hvm/irq.h                      |    3 +--
 xen/include/asm-x86/hvm/nestedhvm.h                |    3 +--
 xen/include/asm-x86/hvm/support.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h       |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h      |    3 +--
 xen/include/asm-x86/hvm/svm/asid.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/emulate.h              |    3 +--
 xen/include/asm-x86/hvm/svm/intr.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/nestedsvm.h            |    3 +--
 xen/include/asm-x86/hvm/svm/svm.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/svmdebug.h             |    3 +--
 xen/include/asm-x86/hvm/svm/vmcb.h                 |    3 +--
 xen/include/asm-x86/hvm/vcpu.h                     |    3 +--
 xen/include/asm-x86/hvm/vioapic.h                  |    3 +--
 xen/include/asm-x86/hvm/vlapic.h                   |    3 +--
 xen/include/asm-x86/hvm/vmx/vmcs.h                 |    3 +--
 xen/include/asm-x86/hvm/vmx/vmx.h                  |    3 +--
 xen/include/asm-x86/hvm/vmx/vvmx.h                 |    3 +--
 xen/include/asm-x86/hvm/vpt.h                      |    3 +--
 xen/include/asm-x86/iommu.h                        |    3 +--
 xen/include/asm-x86/mem_paging.h                   |    3 +--
 xen/include/asm-x86/mem_sharing.h                  |    3 +--
 xen/include/asm-x86/monitor.h                      |    4 +---
 xen/include/asm-x86/p2m.h                          |    3 +--
 xen/include/asm-x86/paging.h                       |    3 +--
 xen/include/asm-x86/shadow.h                       |    3 +--
 xen/include/asm-x86/traps.h                        |    3 +--
 xen/include/asm-x86/vm_event.h                     |    3 +--
 xen/include/asm-x86/vpmu.h                         |    3 +--
 xen/include/asm-x86/xenoprof.h                     |    3 +--
 xen/include/public/io/libxenvchan.h                |    3 +--
 xen/include/xen/acpi.h                             |    3 +--
 xen/include/xen/cper.h                             |    3 +--
 xen/include/xen/cpuidle.h                          |    3 +--
 xen/include/xen/gdbstub.h                          |    3 +--
 xen/include/xen/grant_table.h                      |    3 +--
 xen/include/xen/hvm/iommu.h                        |    3 +--
 xen/include/xen/hvm/irq.h                          |    3 +--
 xen/include/xen/hvm/save.h                         |    3 +--
 xen/include/xen/inttypes.h                         |    4 +---
 xen/include/xen/iommu.h                            |    3 +--
 xen/include/xen/libfdt/fdt.h                       |    4 +---
 xen/include/xen/libfdt/libfdt.h                    |    4 +---
 xen/include/xen/mem_access.h                       |    3 +--
 xen/include/xen/multiboot.h                        |    3 +--
 xen/include/xen/radix-tree.h                       |    3 +--
 xen/include/xen/rbtree.h                           |    3 +--
 xen/include/xen/rcupdate.h                         |    3 +--
 xen/include/xen/vm_event.h                         |    3 +--
 472 files changed, 474 insertions(+), 978 deletions(-)

diff --git a/COPYING b/COPYING
index 07535ad..acd3016 100644
--- a/COPYING
+++ b/COPYING
@@ -343,8 +343,7 @@ the "copyright" line and a pointer to where the full notice is found.
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 
 Also add information on how to contact you by electronic and paper mail.
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index 62995f0..ed7182d 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -14,8 +14,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
diff --git a/m4/systemd.m4 b/m4/systemd.m4
index b04964b..8284993 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -13,8 +13,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 dnl Some optional path options
 AC_DEFUN([AX_SYSTEMD_OPTIONS], [
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
index 2a2fa36..b18a5a3 100644
--- a/stubdom/vtpmmgr/tpmrsa.c
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -19,8 +19,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
index 31e5a8b..08213bb 100644
--- a/stubdom/vtpmmgr/tpmrsa.h
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -21,8 +21,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef TPMRSA_H
 #define TPMRSA_H
diff --git a/tools/blktap2/drivers/libaio-compat.h b/tools/blktap2/drivers/libaio-compat.h
index 47cd96d..ca9ff45 100644
--- a/tools/blktap2/drivers/libaio-compat.h
+++ b/tools/blktap2/drivers/libaio-compat.h
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should  have received a copy  of the GNU  Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/configure b/tools/configure
index d90db47..9cb01ae 100755
--- a/tools/configure
+++ b/tools/configure
@@ -3595,8 +3595,7 @@ esac
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -3805,8 +3804,7 @@ esac
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 
 
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index ff9ac7d..f130a60 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <sys/file.h>
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index e246c25..cafc7b7 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #define _GNU_SOURCE
diff --git a/tools/console/daemon/io.h b/tools/console/daemon/io.h
index f658bfc..d016add 100644
--- a/tools/console/daemon/io.h
+++ b/tools/console/daemon/io.h
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #ifndef CONSOLED_IO_H
diff --git a/tools/console/daemon/main.c b/tools/console/daemon/main.c
index 11de5c9..23860d3 100644
--- a/tools/console/daemon/main.c
+++ b/tools/console/daemon/main.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <getopt.h>
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 71dd185..dbb3b12 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <sys/types.h>
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
index 8725dcd..1295822 100644
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #ifndef CONSOLED_UTILS_H
diff --git a/tools/debugger/gdbsx/gx/gx.h b/tools/debugger/gdbsx/gx/gx.h
index 47594c3..af39575 100644
--- a/tools/debugger/gdbsx/gx/gx.h
+++ b/tools/debugger/gdbsx/gx/gx.h
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 typedef uint16_t domid_t;
diff --git a/tools/debugger/gdbsx/gx/gx_comm.c b/tools/debugger/gdbsx/gx/gx_comm.c
index 7680dbd..5a0c61d 100644
--- a/tools/debugger/gdbsx/gx/gx_comm.c
+++ b/tools/debugger/gdbsx/gx/gx_comm.c
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program; If not, see <http://www.gnu.org/licenses/>.  */
 /*
  * Copyright (C) 2009, Mukesh Rathor, Oracle Corp.  All rights reserved.
  *
@@ -31,9 +29,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This module handles communication with remote gdb.  courtesy 
diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
index c8f0e72..1bec03d 100644
--- a/tools/debugger/gdbsx/gx/gx_local.c
+++ b/tools/debugger/gdbsx/gx/gx_local.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 
diff --git a/tools/debugger/gdbsx/gx/gx_main.c b/tools/debugger/gdbsx/gx/gx_main.c
index e3feee1..a908c45 100644
--- a/tools/debugger/gdbsx/gx/gx_main.c
+++ b/tools/debugger/gdbsx/gx/gx_main.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This module is the main module for gdbsx implementation. gdbsx is a remote
diff --git a/tools/debugger/gdbsx/gx/gx_utils.c b/tools/debugger/gdbsx/gx/gx_utils.c
index e87ffcb..f3c0039 100644
--- a/tools/debugger/gdbsx/gx/gx_utils.c
+++ b/tools/debugger/gdbsx/gx/gx_utils.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdio.h>
diff --git a/tools/debugger/gdbsx/gx/xg_dummy.c b/tools/debugger/gdbsx/gx/xg_dummy.c
index b82899f..e995fad 100644
--- a/tools/debugger/gdbsx/gx/xg_dummy.c
+++ b/tools/debugger/gdbsx/gx/xg_dummy.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdio.h>
 #include <stddef.h>
diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index c95e4ed..8c8a402 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This is the main module to interface with xen. This module exports APIs that
diff --git a/tools/debugger/gdbsx/xg/xg_public.h b/tools/debugger/gdbsx/xg/xg_public.h
index 6236d08..3f905a2 100644
--- a/tools/debugger/gdbsx/xg/xg_public.h
+++ b/tools/debugger/gdbsx/xg/xg_public.h
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #define XGERR(...)   \
diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index fe770a3..1141350 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -17,8 +17,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <inttypes.h>
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 76773b8..0560a7b 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -14,8 +14,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 XEN_ROOT = $(CURDIR)/../../..
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index 33b714a..d3e882a 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -11,8 +11,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 XEN_ROOT = $(CURDIR)/../../../..
diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h b/tools/firmware/hvmloader/acpi/acpi2_0.h
index d698095..78eb43d 100644
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h
@@ -11,8 +11,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 #ifndef _ACPI_2_0_H_
diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index 3276df2..503648c 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -12,8 +12,7 @@
  * details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "acpi2_0.h"
diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index fc1f309..e266dc2 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_pm.asl b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
index 48e6d05..1a7d752 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_pm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
@@ -15,8 +15,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s3.asl b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
index dad1db5..f89ac02 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_s3.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("SSDT_S3.aml", "SSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s4.asl b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
index 0a84381..d589e4b 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_s4.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("SSDT_S4.aml", "SSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_tpm.asl b/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
index 1157eb4..2ae8ad4 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* SSDT for TPM TIS Interface for Xen with Qemu device model. */
diff --git a/tools/firmware/hvmloader/acpi/static_tables.c b/tools/firmware/hvmloader/acpi/static_tables.c
index 323ae31..f4d627b 100644
--- a/tools/firmware/hvmloader/acpi/static_tables.c
+++ b/tools/firmware/hvmloader/acpi/static_tables.c
@@ -12,8 +12,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "acpi2_0.h"
diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index de8d39c..1ac6656 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index f4ccacb..bbde2be 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 84c588c..716d03c 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/mkhex b/tools/firmware/hvmloader/mkhex
index cb21257..d0982d5 100755
--- a/tools/firmware/hvmloader/mkhex
+++ b/tools/firmware/hvmloader/mkhex
@@ -16,8 +16,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 echo "unsigned $1[] = {"
diff --git a/tools/firmware/hvmloader/mp_tables.c b/tools/firmware/hvmloader/mp_tables.c
index fd636a0..69c2885 100644
--- a/tools/firmware/hvmloader/mp_tables.c
+++ b/tools/firmware/hvmloader/mp_tables.c
@@ -24,8 +24,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdint.h>
diff --git a/tools/firmware/hvmloader/optionroms.c b/tools/firmware/hvmloader/optionroms.c
index e35aebc..9708058 100644
--- a/tools/firmware/hvmloader/optionroms.c
+++ b/tools/firmware/hvmloader/optionroms.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index 28dd7bc..bb3da93 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -18,8 +18,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 69b98d6..4eb1a31 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/pir_types.h b/tools/firmware/hvmloader/pir_types.h
index 6e50822..9f9259c 100644
--- a/tools/firmware/hvmloader/pir_types.h
+++ b/tools/firmware/hvmloader/pir_types.h
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) Citrix Systems, 2011
  *
diff --git a/tools/firmware/hvmloader/rombios.c b/tools/firmware/hvmloader/rombios.c
index 810bd24..1f15b94 100644
--- a/tools/firmware/hvmloader/rombios.c
+++ b/tools/firmware/hvmloader/rombios.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/seabios.c b/tools/firmware/hvmloader/seabios.c
index dd7dfbe..c6b3d9f 100644
--- a/tools/firmware/hvmloader/seabios.c
+++ b/tools/firmware/hvmloader/seabios.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/smbios.c
index 4d3d692..210c7b0 100644
--- a/tools/firmware/hvmloader/smbios.c
+++ b/tools/firmware/hvmloader/smbios.c
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/hvmloader/smbios_types.h b/tools/firmware/hvmloader/smbios_types.h
index ff36564..e924f81 100644
--- a/tools/firmware/hvmloader/smbios_types.h
+++ b/tools/firmware/hvmloader/smbios_types.h
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/hvmloader/smp.c b/tools/firmware/hvmloader/smp.c
index fa96878..082b17f 100644
--- a/tools/firmware/hvmloader/smp.c
+++ b/tools/firmware/hvmloader/smp.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/tests.c b/tools/firmware/hvmloader/tests.c
index 52772aa..fea3ad3 100644
--- a/tools/firmware/hvmloader/tests.c
+++ b/tools/firmware/hvmloader/tests.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 32ddcd0..d779fd7 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -14,8 +14,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/rombios/32bit/32bitbios.c b/tools/firmware/rombios/32bit/32bitbios.c
index 22f83f4..87acf20 100644
--- a/tools/firmware/rombios/32bit/32bitbios.c
+++ b/tools/firmware/rombios/32bit/32bitbios.c
@@ -12,8 +12,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/mkhex b/tools/firmware/rombios/32bit/mkhex
index 4517e36..7200d00 100644
--- a/tools/firmware/rombios/32bit/mkhex
+++ b/tools/firmware/rombios/32bit/mkhex
@@ -16,8 +16,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 echo "unsigned $1[] = {"
diff --git a/tools/firmware/rombios/32bit/pmm.c b/tools/firmware/rombios/32bit/pmm.c
index 4a279ca..09fec42 100644
--- a/tools/firmware/rombios/32bit/pmm.c
+++ b/tools/firmware/rombios/32bit/pmm.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  *  Copyright (C) 2009 FUJITSU LIMITED
  *
diff --git a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
index 01d4f2f..beef5a4 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c b/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
index d45f9b0..59d16bb 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/util.c b/tools/firmware/rombios/32bit/util.c
index a47bb71..e473e89 100644
--- a/tools/firmware/rombios/32bit/util.c
+++ b/tools/firmware/rombios/32bit/util.c
@@ -14,8 +14,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdarg.h>
 #include <stdint.h>
diff --git a/tools/firmware/rombios/32bitgateway.c b/tools/firmware/rombios/32bitgateway.c
index fc82e07..3d58a6b 100644
--- a/tools/firmware/rombios/32bitgateway.c
+++ b/tools/firmware/rombios/32bitgateway.c
@@ -15,8 +15,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  * Copyright (c) 2008, Citrix Systems, Inc.
diff --git a/tools/firmware/rombios/apmbios.S b/tools/firmware/rombios/apmbios.S
index a010949..814be8f 100644
--- a/tools/firmware/rombios/apmbios.S
+++ b/tools/firmware/rombios/apmbios.S
@@ -15,8 +15,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 #if defined(APM_REAL)
 #define APMSYM(s) apmreal_ ## s
diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c
index 057aced..58ace9b 100644
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -21,8 +21,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 // ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
 
diff --git a/tools/firmware/rombios/rombios.h b/tools/firmware/rombios/rombios.h
index 0308a18..8726d37 100644
--- a/tools/firmware/rombios/rombios.h
+++ b/tools/firmware/rombios/rombios.h
@@ -15,8 +15,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 /* define it to include QEMU specific code */
 //#define BX_QEMU
diff --git a/tools/firmware/rombios/tcgbios.c b/tools/firmware/rombios/tcgbios.c
index c7ec261..e725ef9 100644
--- a/tools/firmware/rombios/tcgbios.c
+++ b/tools/firmware/rombios/tcgbios.c
@@ -13,8 +13,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/vgabios/COPYING b/tools/firmware/vgabios/COPYING
index 223ede7..0595626 100644
--- a/tools/firmware/vgabios/COPYING
+++ b/tools/firmware/vgabios/COPYING
@@ -484,8 +484,7 @@ convey the exclusion of warranty; and each file should have at least the
     Lesser General Public License for more details.
 
     You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 Also add information on how to contact you by electronic and paper mail.
 
diff --git a/tools/firmware/vgabios/biossums.c b/tools/firmware/vgabios/biossums.c
index 6288498..85ecc04 100644
--- a/tools/firmware/vgabios/biossums.c
+++ b/tools/firmware/vgabios/biossums.c
@@ -12,8 +12,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tools/firmware/vgabios/clext.c b/tools/firmware/vgabios/clext.c
index c501227..d727cd5 100644
--- a/tools/firmware/vgabios/clext.c
+++ b/tools/firmware/vgabios/clext.c
@@ -14,8 +14,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 
 //#define CIRRUS_VESA3_PMINFO
diff --git a/tools/firmware/vgabios/vbe.c b/tools/firmware/vgabios/vbe.c
index a13e223..c506690 100644
--- a/tools/firmware/vgabios/vbe.c
+++ b/tools/firmware/vgabios/vbe.c
@@ -13,8 +13,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 // ============================================================================================
 //  
diff --git a/tools/firmware/vgabios/vgabios.c b/tools/firmware/vgabios/vgabios.c
index a9dbe00..1c75b7d 100644
--- a/tools/firmware/vgabios/vgabios.c
+++ b/tools/firmware/vgabios/vgabios.c
@@ -17,8 +17,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 // ============================================================================================
 //  
diff --git a/tools/hotplug/Linux/block-common.sh b/tools/hotplug/Linux/block-common.sh
index cc374ef..ee95009 100644
--- a/tools/hotplug/Linux/block-common.sh
+++ b/tools/hotplug/Linux/block-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/block-drbd-probe b/tools/hotplug/Linux/block-drbd-probe
index 247a9d0..635d9f9 100755
--- a/tools/hotplug/Linux/block-drbd-probe
+++ b/tools/hotplug/Linux/block-drbd-probe
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 # Usage:
 #     block-drbd-probe devicename
diff --git a/tools/hotplug/Linux/external-device-migrate b/tools/hotplug/Linux/external-device-migrate
index a411348..f5942a6 100644
--- a/tools/hotplug/Linux/external-device-migrate
+++ b/tools/hotplug/Linux/external-device-migrate
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -x
diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index 122bcfb..c6a7e96 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 #
diff --git a/tools/hotplug/Linux/logging.sh b/tools/hotplug/Linux/logging.sh
index c1bc699..3e94df1 100644
--- a/tools/hotplug/Linux/logging.sh
+++ b/tools/hotplug/Linux/logging.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 log() {
diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh
index fa0a18e..6e8d584 100644
--- a/tools/hotplug/Linux/vif-common.sh
+++ b/tools/hotplug/Linux/vif-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh.in b/tools/hotplug/Linux/xen-hotplug-common.sh.in
index afb240f..d5d0b69 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh.in
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 dir=$(dirname "$0")
diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh
index 3c63c55..92ffa60 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/xen-script-common.sh b/tools/hotplug/Linux/xen-script-common.sh
index f6841ac..370a50a 100644
--- a/tools/hotplug/Linux/xen-script-common.sh
+++ b/tools/hotplug/Linux/xen-script-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index 75c4cbe..ba53ff4 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/fat/fat.h b/tools/libfsimage/fat/fat.h
index f72b72a..2abb430 100644
--- a/tools/libfsimage/fat/fat.h
+++ b/tools/libfsimage/fat/fat.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 
diff --git a/tools/libfsimage/fat/fsys_fat.c b/tools/libfsimage/fat/fsys_fat.c
index d22d243..b8129a8 100644
--- a/tools/libfsimage/fat/fsys_fat.c
+++ b/tools/libfsimage/fat/fsys_fat.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <limits.h>
diff --git a/tools/libfsimage/iso9660/fsys_iso9660.c b/tools/libfsimage/iso9660/fsys_iso9660.c
index b991cfc..5dbf100 100644
--- a/tools/libfsimage/iso9660/fsys_iso9660.c
+++ b/tools/libfsimage/iso9660/fsys_iso9660.c
@@ -15,8 +15,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  References:
diff --git a/tools/libfsimage/iso9660/iso9660.h b/tools/libfsimage/iso9660/iso9660.h
index 83d0019..4ea9b3e 100644
--- a/tools/libfsimage/iso9660/iso9660.h
+++ b/tools/libfsimage/iso9660/iso9660.h
@@ -15,8 +15,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  References:
diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 4aa9bfb..92c3b2b 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/ufs/fsys_ufs.c b/tools/libfsimage/ufs/fsys_ufs.c
index be51411..cf7e22a 100644
--- a/tools/libfsimage/ufs/fsys_ufs.c
+++ b/tools/libfsimage/ufs/fsys_ufs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/xfs/fsys_xfs.c b/tools/libfsimage/xfs/fsys_xfs.c
index 0261a52..f39d096 100644
--- a/tools/libfsimage/xfs/fsys_xfs.c
+++ b/tools/libfsimage/xfs/fsys_xfs.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/xfs/xfs.h b/tools/libfsimage/xfs/xfs.h
index 02f8dcd..4069928 100644
--- a/tools/libfsimage/xfs/xfs.h
+++ b/tools/libfsimage/xfs/xfs.h
@@ -20,8 +20,7 @@
  *  other software, or any other product whatsoever.
  * 
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write the Free Software Foundation, Inc., 59
- *  Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  * 
  *  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  *  Mountain View, CA  94043, or:
diff --git a/tools/libfsimage/zfs/Makefile b/tools/libfsimage/zfs/Makefile
index 9fb0aab..4b9f131 100644
--- a/tools/libfsimage/zfs/Makefile
+++ b/tools/libfsimage/zfs/Makefile
@@ -13,8 +13,7 @@
 #  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#  along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 # 
diff --git a/tools/libfsimage/zfs/filesys.h b/tools/libfsimage/zfs/filesys.h
index 1fae8e8..36cc720 100644
--- a/tools/libfsimage/zfs/filesys.h
+++ b/tools/libfsimage/zfs/filesys.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsi_zfs.c b/tools/libfsimage/zfs/fsi_zfs.c
index 05148bc..7514587 100644
--- a/tools/libfsimage/zfs/fsi_zfs.c
+++ b/tools/libfsimage/zfs/fsi_zfs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsi_zfs.h b/tools/libfsimage/zfs/fsi_zfs.h
index c849147..fb4dc23 100644
--- a/tools/libfsimage/zfs/fsi_zfs.h
+++ b/tools/libfsimage/zfs/fsi_zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsys_zfs.c b/tools/libfsimage/zfs/fsys_zfs.c
index 863232b..e881fbb 100644
--- a/tools/libfsimage/zfs/fsys_zfs.c
+++ b/tools/libfsimage/zfs/fsys_zfs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsys_zfs.h b/tools/libfsimage/zfs/fsys_zfs.h
index 36aa1e7..5cd627d 100644
--- a/tools/libfsimage/zfs/fsys_zfs.h
+++ b/tools/libfsimage/zfs/fsys_zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/mb_info.h b/tools/libfsimage/zfs/mb_info.h
index 1e1e63b..16e9013 100644
--- a/tools/libfsimage/zfs/mb_info.h
+++ b/tools/libfsimage/zfs/mb_info.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libfsimage/zfs/shared.h b/tools/libfsimage/zfs/shared.h
index 0bf6751..e4a239a 100644
--- a/tools/libfsimage/zfs/shared.h
+++ b/tools/libfsimage/zfs/shared.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dmu.h b/tools/libfsimage/zfs/zfs-include/dmu.h
index 7faa708..b39a951 100644
--- a/tools/libfsimage/zfs/zfs-include/dmu.h
+++ b/tools/libfsimage/zfs/zfs-include/dmu.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dmu_objset.h b/tools/libfsimage/zfs/zfs-include/dmu_objset.h
index 8d1cf8e..2680fcf 100644
--- a/tools/libfsimage/zfs/zfs-include/dmu_objset.h
+++ b/tools/libfsimage/zfs/zfs-include/dmu_objset.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dnode.h b/tools/libfsimage/zfs/zfs-include/dnode.h
index 5f6e4bb..dd90a87 100644
--- a/tools/libfsimage/zfs/zfs-include/dnode.h
+++ b/tools/libfsimage/zfs/zfs-include/dnode.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dsl_dataset.h b/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
index a8c60c4..470b607 100644
--- a/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
+++ b/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dsl_dir.h b/tools/libfsimage/zfs/zfs-include/dsl_dir.h
index 591e197..0e71b6b 100644
--- a/tools/libfsimage/zfs/zfs-include/dsl_dir.h
+++ b/tools/libfsimage/zfs/zfs-include/dsl_dir.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/sa_impl.h b/tools/libfsimage/zfs/zfs-include/sa_impl.h
index 4d93558..0679c93 100644
--- a/tools/libfsimage/zfs/zfs-include/sa_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/sa_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/spa.h b/tools/libfsimage/zfs/zfs-include/spa.h
index 4c943310..ee708ef 100644
--- a/tools/libfsimage/zfs/zfs-include/spa.h
+++ b/tools/libfsimage/zfs/zfs-include/spa.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/uberblock_impl.h b/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
index 9e70ac0..282d3b9 100644
--- a/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/vdev_impl.h b/tools/libfsimage/zfs/zfs-include/vdev_impl.h
index ba427dd..f3823b2 100644
--- a/tools/libfsimage/zfs/zfs-include/vdev_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/vdev_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zap_impl.h b/tools/libfsimage/zfs/zfs-include/zap_impl.h
index ebb57a6..7adfc34 100644
--- a/tools/libfsimage/zfs/zfs-include/zap_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/zap_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zap_leaf.h b/tools/libfsimage/zfs/zfs-include/zap_leaf.h
index 4ff3515..ecf3faa 100644
--- a/tools/libfsimage/zfs/zfs-include/zap_leaf.h
+++ b/tools/libfsimage/zfs/zfs-include/zap_leaf.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs.h b/tools/libfsimage/zfs/zfs-include/zfs.h
index c0887d5..592d23a 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs_acl.h b/tools/libfsimage/zfs/zfs-include/zfs_acl.h
index 77ebb8d..6a685e0 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs_acl.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs_acl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs_znode.h b/tools/libfsimage/zfs/zfs-include/zfs_znode.h
index ea37c08..902c497 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs_znode.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs_znode.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zil.h b/tools/libfsimage/zfs/zfs-include/zil.h
index 87c1dc5..f34173c 100644
--- a/tools/libfsimage/zfs/zfs-include/zil.h
+++ b/tools/libfsimage/zfs/zfs-include/zil.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zio.h b/tools/libfsimage/zfs/zfs-include/zio.h
index 298017a..513f321 100644
--- a/tools/libfsimage/zfs/zfs-include/zio.h
+++ b/tools/libfsimage/zfs/zfs-include/zio.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zio_checksum.h b/tools/libfsimage/zfs/zfs-include/zio_checksum.h
index 28ba792..5f22f29 100644
--- a/tools/libfsimage/zfs/zfs-include/zio_checksum.h
+++ b/tools/libfsimage/zfs/zfs-include/zio_checksum.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_fletcher.c b/tools/libfsimage/zfs/zfs_fletcher.c
index 34a034e..cc9e8c4 100644
--- a/tools/libfsimage/zfs/zfs_fletcher.c
+++ b/tools/libfsimage/zfs/zfs_fletcher.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_lzjb.c b/tools/libfsimage/zfs/zfs_lzjb.c
index c617362..0b11eee 100644
--- a/tools/libfsimage/zfs/zfs_lzjb.c
+++ b/tools/libfsimage/zfs/zfs_lzjb.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_sha256.c b/tools/libfsimage/zfs/zfs_sha256.c
index 393eaee..616fc0a 100644
--- a/tools/libfsimage/zfs/zfs_sha256.c
+++ b/tools/libfsimage/zfs/zfs_sha256.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index de10817..77be4e7 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index e66bc4e..8a9629b 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 6365d36..0944a0e 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 6712df0..0394644 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/node.c b/tools/libvchan/node.c
index cab8368..f1638f0 100644
--- a/tools/libvchan/node.c
+++ b/tools/libvchan/node.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index a7d059a..600aef6 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <xen/libelf/libelf.h>
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index ac7e5fd..de3c0ad 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -19,8 +19,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENCTRL_H
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index e97944b..5121d9b 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index f837bde..1a1a185 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENGUEST_H
diff --git a/tools/libxc/include/xentoollog.h b/tools/libxc/include/xentoollog.h
index 85d3da9..853e9c7 100644
--- a/tools/libxc/include/xentoollog.h
+++ b/tools/libxc/include/xentoollog.h
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENTOOLLOG_H
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
index 0f3c5ed..87a0fdf 100644
--- a/tools/libxc/xc_altp2m.c
+++ b/tools/libxc/xc_altp2m.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_compression.c b/tools/libxc/xc_compression.c
index d42e651..b1b16e8 100644
--- a/tools/libxc/xc_compression.c
+++ b/tools/libxc/xc_compression.c
@@ -22,8 +22,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index dfa424b..011336c 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 5867030..ffbe490 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 57d4715..d8570fd 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011 Citrix Systems
  *
diff --git a/tools/libxc/xc_core_arm.h b/tools/libxc/xc_core_arm.h
index 24781eb..162f7a7 100644
--- a/tools/libxc/xc_core_arm.h
+++ b/tools/libxc/xc_core_arm.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2012 Citrix Systems
  *
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index 93ebcbb..679e753 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
  *                    VA Linux Systems Japan K.K.
diff --git a/tools/libxc/xc_core_x86.h b/tools/libxc/xc_core_x86.h
index d5e04e7..867146b 100644
--- a/tools/libxc/xc_core_x86.h
+++ b/tools/libxc/xc_core_x86.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
  *                    VA Linux Systems Japan K.K.
diff --git a/tools/libxc/xc_cpu_hotplug.c b/tools/libxc/xc_cpu_hotplug.c
index e4659c0..58c2a0f 100644
--- a/tools/libxc/xc_cpu_hotplug.c
+++ b/tools/libxc/xc_cpu_hotplug.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index 66cc82e..c3ddc80 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef __LIBXC_CPUFEATURE_H
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index c97f91a..e146a3e 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdlib.h>
diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index 828f234..c42273e 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2009, J Gross.
  */
diff --git a/tools/libxc/xc_csched.c b/tools/libxc/xc_csched.c
index 390c645..bf03bfc 100644
--- a/tools/libxc/xc_csched.c
+++ b/tools/libxc/xc_csched.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_csched2.c b/tools/libxc/xc_csched2.c
index 6da6a46..ed99605 100644
--- a/tools/libxc/xc_csched2.c
+++ b/tools/libxc/xc_csched2.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 065debb..b00d667 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xc_dom_armzimageloader.c
index 2b28781..0df8c2a 100644
--- a/tools/libxc/xc_dom_armzimageloader.c
+++ b/tools/libxc/xc_dom_armzimageloader.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index e1de5b5..740601a 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Some of the field descriptions were copied from "The Multiboot
  * Specification", Copyright 1995, 96 Bryan Ford <baford@cs.utah.edu>,
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f82db2d..8e06406 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 3bb17dd..7fde42a 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  * written 2007 by Jeremy Fitzhardinge <jeremy@xensource.com>
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 617cd96..a3abb99 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index b100ce1..8466677 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 6ce1062..66ea9d6 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 6a04399..3d40fa4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 582b0ae..2ee26fb 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2003, K A Fraser.
  */
diff --git a/tools/libxc/xc_efi.h b/tools/libxc/xc_efi.h
index 734da98..dbe105b 100644
--- a/tools/libxc/xc_efi.h
+++ b/tools/libxc/xc_efi.h
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) 1999 VA Linux Systems
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
diff --git a/tools/libxc/xc_elf.h b/tools/libxc/xc_elf.h
index cb616d6..acbc028 100644
--- a/tools/libxc/xc_elf.h
+++ b/tools/libxc/xc_elf.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <xen/libelf/elfstructs.h>
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 2e0679e..15f0580 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2004, K A Fraser.
  */
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index e24a2e7..b533656 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 43abf01..f42d140 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_freebsd.c b/tools/libxc/xc_freebsd.c
index 8e70a91..9dd48a3 100644
--- a/tools/libxc/xc_freebsd.c
+++ b/tools/libxc/xc_freebsd.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 011112b..4d31a1e 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 4076e47..60335d8 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 932b47c..6e3c958 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdlib.h>
diff --git a/tools/libxc/xc_hvm_build_arm.c b/tools/libxc/xc_hvm_build_arm.c
index ff66689..14f7c45 100644
--- a/tools/libxc/xc_hvm_build_arm.c
+++ b/tools/libxc/xc_hvm_build_arm.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index a6e9203..ec11f15 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stddef.h>
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 6121d80..c67c71c 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 2687424..e375428 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
index 5cfa611..3634c39 100644
--- a/tools/libxc/xc_mem_access.c
+++ b/tools/libxc/xc_mem_access.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_mem_paging.c b/tools/libxc/xc_mem_paging.c
index 4aa48d6..28611f4 100644
--- a/tools/libxc/xc_mem_paging.c
+++ b/tools/libxc/xc_mem_paging.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c
index 0960c6d..deb0aa4 100644
--- a/tools/libxc/xc_memshr.c
+++ b/tools/libxc/xc_memshr.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e703684..4f6498f 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #undef NDEBUG
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index b827bbb..c613545 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_bitops.h"
diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
index d5f87da..065669c 100644
--- a/tools/libxc/xc_monitor.c
+++ b/tools/libxc/xc_monitor.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 8a90ef3..54f1d7b 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 76978a0..902429e 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index c2a8230..7bb522f 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <inttypes.h>
diff --git a/tools/libxc/xc_pagetab.c b/tools/libxc/xc_pagetab.c
index 8525967..ec97890 100644
--- a/tools/libxc/xc_pagetab.c
+++ b/tools/libxc/xc_pagetab.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index 9b064b8..23108d6 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c
index 5a7148e..5b38cf1 100644
--- a/tools/libxc/xc_pm.c
+++ b/tools/libxc/xc_pm.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 2ffebd9..7c39897 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 247a408..2df1d59 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XC_PRIVATE_H
diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
index e67bebd..87d4324 100644
--- a/tools/libxc/xc_resume.c
+++ b/tools/libxc/xc_resume.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index b2d1cc5..d59e5ce 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -19,8 +19,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7257a54..7e5d847 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_suspend.c b/tools/libxc/xc_suspend.c
index e22f4ac..bba36e7 100644
--- a/tools/libxc/xc_suspend.c
+++ b/tools/libxc/xc_suspend.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <unistd.h>
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index a4de491..695939a 100644
--- a/tools/libxc/xc_tbuf.c

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:49:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgX-0008Sp-PV; Fri, 31 Jul 2015 13:49:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgW-0008SX-Cg
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:16 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	A2/A2-12889-BDC7BB55; Fri, 31 Jul 2015 13:49:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1438350549!36943738!1
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 28088 invoked from network); 31 Jul 2015 13:49:10 -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;
	31 Jul 2015 13:49:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgP-0004ir-IC
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgP-0007hA-FR
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:09 +0000
Date: Fri, 31 Jul 2015 13:49:09 +0000
Message-Id: <E1ZLAgP-0007hA-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Replace FSF street address with
	canonical URL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 443701ef0c7ff30872e27419cf4356fb6bdb4059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 29 11:00:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jul 29 11:14:07 2015 +0100

    Replace FSF street address with canonical URL
    
    As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.
    
    This is the result of:
    $ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl
    
    Where fsf.pl is:
        #!/usr/bin/perl -w -pi.bak -0777
        my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
        my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;
    
        my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;
    
        my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
        my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
        my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;
    
        s|$inwt$br$mass|$repl|m;
        s|$inwt$br$franklin|$repl|m;
        s|$inwt$br$temple|$repl|m;
    
    The only remaining mentions of these addresses are in COPYING files which I
    haven't touched.
    
    Some of the changed files are imports from elsewhere, however
    filtering them out is tricky, I think it is tolerable to have these
    files be modified here and then perhaps reverted on the next sync,
    since it's only 1-2 lines and obvious what is going on.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 COPYING                                            |    3 +--
 m4/pkg.m4                                          |    3 +--
 m4/systemd.m4                                      |    3 +--
 stubdom/vtpmmgr/tpmrsa.c                           |    3 +--
 stubdom/vtpmmgr/tpmrsa.h                           |    3 +--
 tools/blktap2/drivers/libaio-compat.h              |    4 +---
 tools/configure                                    |    6 ++----
 tools/console/client/main.c                        |    3 +--
 tools/console/daemon/io.c                          |    3 +--
 tools/console/daemon/io.h                          |    3 +--
 tools/console/daemon/main.c                        |    3 +--
 tools/console/daemon/utils.c                       |    3 +--
 tools/console/daemon/utils.h                       |    3 +--
 tools/debugger/gdbsx/gx/gx.h                       |    4 +---
 tools/debugger/gdbsx/gx/gx_comm.c                  |    8 ++------
 tools/debugger/gdbsx/gx/gx_local.c                 |    4 +---
 tools/debugger/gdbsx/gx/gx_main.c                  |    4 +---
 tools/debugger/gdbsx/gx/gx_utils.c                 |    4 +---
 tools/debugger/gdbsx/gx/xg_dummy.c                 |    4 +---
 tools/debugger/gdbsx/xg/xg_main.c                  |    4 +---
 tools/debugger/gdbsx/xg/xg_public.h                |    4 +---
 tools/firmware/hvmloader/32bitbios_support.c       |    3 +--
 tools/firmware/hvmloader/Makefile                  |    3 +--
 tools/firmware/hvmloader/acpi/Makefile             |    3 +--
 tools/firmware/hvmloader/acpi/acpi2_0.h            |    3 +--
 tools/firmware/hvmloader/acpi/build.c              |    3 +--
 tools/firmware/hvmloader/acpi/dsdt.asl             |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_pm.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s3.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s4.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_tpm.asl         |    3 +--
 tools/firmware/hvmloader/acpi/static_tables.c      |    3 +--
 tools/firmware/hvmloader/cacheattr.c               |    3 +--
 tools/firmware/hvmloader/e820.c                    |    3 +--
 tools/firmware/hvmloader/hvmloader.c               |    3 +--
 tools/firmware/hvmloader/mkhex                     |    3 +--
 tools/firmware/hvmloader/mp_tables.c               |    3 +--
 tools/firmware/hvmloader/optionroms.c              |    3 +--
 tools/firmware/hvmloader/ovmf.c                    |    3 +--
 tools/firmware/hvmloader/pci.c                     |    3 +--
 tools/firmware/hvmloader/pir_types.h               |    3 +--
 tools/firmware/hvmloader/rombios.c                 |    3 +--
 tools/firmware/hvmloader/seabios.c                 |    3 +--
 tools/firmware/hvmloader/smbios.c                  |    3 +--
 tools/firmware/hvmloader/smbios_types.h            |    3 +--
 tools/firmware/hvmloader/smp.c                     |    3 +--
 tools/firmware/hvmloader/tests.c                   |    3 +--
 tools/firmware/hvmloader/util.c                    |    3 +--
 tools/firmware/rombios/32bit/32bitbios.c           |    3 +--
 tools/firmware/rombios/32bit/mkhex                 |    3 +--
 tools/firmware/rombios/32bit/pmm.c                 |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c     |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c |    3 +--
 tools/firmware/rombios/32bit/util.c                |    3 +--
 tools/firmware/rombios/32bitgateway.c              |    3 +--
 tools/firmware/rombios/apmbios.S                   |    3 +--
 tools/firmware/rombios/rombios.c                   |    3 +--
 tools/firmware/rombios/rombios.h                   |    3 +--
 tools/firmware/rombios/tcgbios.c                   |    3 +--
 tools/firmware/vgabios/COPYING                     |    3 +--
 tools/firmware/vgabios/biossums.c                  |    3 +--
 tools/firmware/vgabios/clext.c                     |    3 +--
 tools/firmware/vgabios/vbe.c                       |    3 +--
 tools/firmware/vgabios/vgabios.c                   |    3 +--
 tools/hotplug/Linux/block-common.sh                |    3 +--
 tools/hotplug/Linux/block-drbd-probe               |    3 +--
 tools/hotplug/Linux/external-device-migrate        |    3 +--
 tools/hotplug/Linux/locking.sh                     |    3 +--
 tools/hotplug/Linux/logging.sh                     |    3 +--
 tools/hotplug/Linux/vif-common.sh                  |    3 +--
 tools/hotplug/Linux/xen-hotplug-common.sh.in       |    3 +--
 tools/hotplug/Linux/xen-network-common.sh          |    3 +--
 tools/hotplug/Linux/xen-script-common.sh           |    3 +--
 tools/libfsimage/ext2fs/fsys_ext2fs.c              |    3 +--
 tools/libfsimage/fat/fat.h                         |    3 +--
 tools/libfsimage/fat/fsys_fat.c                    |    3 +--
 tools/libfsimage/iso9660/fsys_iso9660.c            |    3 +--
 tools/libfsimage/iso9660/iso9660.h                 |    3 +--
 tools/libfsimage/reiserfs/fsys_reiserfs.c          |    3 +--
 tools/libfsimage/ufs/fsys_ufs.c                    |    3 +--
 tools/libfsimage/xfs/fsys_xfs.c                    |    3 +--
 tools/libfsimage/xfs/xfs.h                         |    3 +--
 tools/libfsimage/zfs/Makefile                      |    3 +--
 tools/libfsimage/zfs/filesys.h                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.c                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.h                     |    3 +--
 tools/libfsimage/zfs/fsys_zfs.c                    |    3 +--
 tools/libfsimage/zfs/fsys_zfs.h                    |    3 +--
 tools/libfsimage/zfs/mb_info.h                     |    3 +--
 tools/libfsimage/zfs/shared.h                      |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu_objset.h      |    3 +--
 tools/libfsimage/zfs/zfs-include/dnode.h           |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dataset.h     |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dir.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/sa_impl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/spa.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/uberblock_impl.h  |    3 +--
 tools/libfsimage/zfs/zfs-include/vdev_impl.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_impl.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_leaf.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_acl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_znode.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zil.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio_checksum.h    |    3 +--
 tools/libfsimage/zfs/zfs_fletcher.c                |    3 +--
 tools/libfsimage/zfs/zfs_lzjb.c                    |    3 +--
 tools/libfsimage/zfs/zfs_sha256.c                  |    3 +--
 tools/libvchan/init.c                              |    3 +--
 tools/libvchan/io.c                                |    3 +--
 tools/libvchan/libxenvchan.h                       |    3 +--
 tools/libvchan/node-select.c                       |    3 +--
 tools/libvchan/node.c                              |    3 +--
 tools/libxc/include/xc_dom.h                       |    3 +--
 tools/libxc/include/xenctrl.h                      |    3 +--
 tools/libxc/include/xenctrlosdep.h                 |    3 +--
 tools/libxc/include/xenguest.h                     |    3 +--
 tools/libxc/include/xentoollog.h                   |    3 +--
 tools/libxc/xc_altp2m.c                            |    3 +--
 tools/libxc/xc_compression.c                       |    3 +--
 tools/libxc/xc_core.c                              |    3 +--
 tools/libxc/xc_core.h                              |    3 +--
 tools/libxc/xc_core_arm.c                          |    3 +--
 tools/libxc/xc_core_arm.h                          |    3 +--
 tools/libxc/xc_core_x86.c                          |    3 +--
 tools/libxc/xc_core_x86.h                          |    3 +--
 tools/libxc/xc_cpu_hotplug.c                       |    3 +--
 tools/libxc/xc_cpufeature.h                        |    3 +--
 tools/libxc/xc_cpuid_x86.c                         |    3 +--
 tools/libxc/xc_cpupool.c                           |    3 +--
 tools/libxc/xc_csched.c                            |    3 +--
 tools/libxc/xc_csched2.c                           |    3 +--
 tools/libxc/xc_dom_arm.c                           |    3 +--
 tools/libxc/xc_dom_armzimageloader.c               |    3 +--
 tools/libxc/xc_dom_binloader.c                     |    3 +--
 tools/libxc/xc_dom_boot.c                          |    3 +--
 tools/libxc/xc_dom_bzimageloader.c                 |    3 +--
 tools/libxc/xc_dom_compat_linux.c                  |    3 +--
 tools/libxc/xc_dom_core.c                          |    3 +--
 tools/libxc/xc_dom_elfloader.c                     |    3 +--
 tools/libxc/xc_dom_x86.c                           |    3 +--
 tools/libxc/xc_domain.c                            |    3 +--
 tools/libxc/xc_efi.h                               |    3 +--
 tools/libxc/xc_elf.h                               |    3 +--
 tools/libxc/xc_evtchn.c                            |    3 +--
 tools/libxc/xc_flask.c                             |    3 +--
 tools/libxc/xc_foreign_memory.c                    |    3 +--
 tools/libxc/xc_freebsd.c                           |    3 +--
 tools/libxc/xc_freebsd_osdep.c                     |    3 +--
 tools/libxc/xc_gnttab.c                            |    3 +--
 tools/libxc/xc_hcall_buf.c                         |    3 +--
 tools/libxc/xc_hvm_build_arm.c                     |    3 +--
 tools/libxc/xc_hvm_build_x86.c                     |    3 +--
 tools/libxc/xc_linux.c                             |    3 +--
 tools/libxc/xc_linux_osdep.c                       |    3 +--
 tools/libxc/xc_mem_access.c                        |    3 +--
 tools/libxc/xc_mem_paging.c                        |    3 +--
 tools/libxc/xc_memshr.c                            |    3 +--
 tools/libxc/xc_minios.c                            |    3 +--
 tools/libxc/xc_misc.c                              |    3 +--
 tools/libxc/xc_monitor.c                           |    3 +--
 tools/libxc/xc_netbsd.c                            |    3 +--
 tools/libxc/xc_nomigrate.c                         |    3 +--
 tools/libxc/xc_offline_page.c                      |    3 +--
 tools/libxc/xc_pagetab.c                           |    3 +--
 tools/libxc/xc_physdev.c                           |    3 +--
 tools/libxc/xc_pm.c                                |    3 +--
 tools/libxc/xc_private.c                           |    3 +--
 tools/libxc/xc_private.h                           |    3 +--
 tools/libxc/xc_resume.c                            |    3 +--
 tools/libxc/xc_rt.c                                |    3 +--
 tools/libxc/xc_solaris.c                           |    3 +--
 tools/libxc/xc_suspend.c                           |    3 +--
 tools/libxc/xc_tbuf.c                              |    3 +--
 tools/libxc/xc_tmem.c                              |    3 +--
 tools/libxc/xc_vm_event.c                          |    3 +--
 tools/libxc/xg_private.c                           |    3 +--
 tools/libxc/xg_private.h                           |    3 +--
 tools/libxc/xg_save_restore.h                      |    3 +--
 tools/libxc/xtl_core.c                             |    3 +--
 tools/libxc/xtl_logger_stdio.c                     |    3 +--
 tools/memshr/bidir-daemon.c                        |    3 +--
 tools/memshr/bidir-daemon.h                        |    3 +--
 tools/memshr/bidir-hash.c                          |    3 +--
 tools/memshr/bidir-hash.h                          |    3 +--
 tools/memshr/bidir-namedefs.h                      |    3 +--
 tools/memshr/interface.c                           |    3 +--
 tools/memshr/memshr-priv.h                         |    3 +--
 tools/memshr/memshr.h                              |    3 +--
 tools/memshr/shm.c                                 |    3 +--
 tools/memshr/shm.h                                 |    3 +--
 tools/misc/gtracestat.c                            |    3 +--
 tools/misc/gtraceview.c                            |    3 +--
 tools/misc/xen-ringwatch                           |    4 +---
 tools/misc/xencov.c                                |    3 +--
 tools/misc/xencov_split                            |    3 +--
 tools/misc/xenpm.c                                 |    3 +--
 tools/misc/xenpvnetboot                            |    4 +---
 tools/ocaml/LICENSE                                |    3 +--
 tools/pygrub/src/ExtLinuxConf.py                   |    3 +--
 tools/pygrub/src/GrubConf.py                       |    3 +--
 tools/pygrub/src/pygrub                            |    3 +--
 tools/python/xen/lowlevel/xl/xl.c                  |    3 +--
 tools/python/xen/lowlevel/xs/xs.c                  |    3 +--
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/config/setup.conf             |    3 +--
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        |    3 +--
 tools/tests/mce-test/tools/xen-mceinj.c            |    3 +--
 tools/tests/utests/run_all_tests.py                |    3 +--
 tools/tests/x86_emulator/blowfish.c                |    3 +--
 tools/xenbackendd/xenbackendd.c                    |    3 +--
 tools/xenmon/COPYING                               |    3 +--
 tools/xenmon/setmask.c                             |    3 +--
 tools/xenmon/xenbaked.c                            |    3 +--
 tools/xenmon/xenbaked.h                            |    3 +--
 tools/xenmon/xenmon.py                             |    3 +--
 tools/xenpaging/file_ops.c                         |    3 +--
 tools/xenpaging/file_ops.h                         |    3 +--
 tools/xenpaging/policy.h                           |    3 +--
 tools/xenpaging/policy_default.c                   |    3 +--
 tools/xenpaging/xenpaging.c                        |    3 +--
 tools/xenpaging/xenpaging.h                        |    3 +--
 tools/xenpmd/xenpmd.c                              |    3 +--
 tools/xenstat/libxenstat/COPYING                   |    3 +--
 tools/xenstat/xentop/xentop.1                      |    3 +--
 tools/xenstat/xentop/xentop.c                      |    3 +--
 tools/xenstore/COPYING                             |    3 +--
 tools/xenstore/include/xenstore.h                  |    3 +--
 tools/xenstore/include/xenstore_lib.h              |    3 +--
 tools/xenstore/talloc.c                            |    3 +--
 tools/xenstore/talloc.h                            |    3 +--
 tools/xenstore/tdb.c                               |    3 +--
 tools/xenstore/tdb.h                               |    3 +--
 tools/xenstore/xenstored_core.c                    |    3 +--
 tools/xenstore/xenstored_core.h                    |    3 +--
 tools/xenstore/xenstored_domain.c                  |    3 +--
 tools/xenstore/xenstored_domain.h                  |    3 +--
 tools/xenstore/xenstored_minios.c                  |    3 +--
 tools/xenstore/xenstored_posix.c                   |    3 +--
 tools/xenstore/xenstored_transaction.c             |    3 +--
 tools/xenstore/xenstored_transaction.h             |    3 +--
 tools/xenstore/xenstored_watch.c                   |    3 +--
 tools/xenstore/xenstored_watch.h                   |    3 +--
 tools/xenstore/xs.c                                |    3 +--
 tools/xenstore/xs_lib.c                            |    3 +--
 tools/xentrace/xenalyze.c                          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.c          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.h          |    3 +--
 .../linux-2.6/platform-pci/xen_support.c           |    3 +--
 xen/COPYING                                        |    3 +--
 xen/arch/arm/arm32/lib/lib1funcs.S                 |    4 +---
 xen/arch/arm/arm32/lib/lshrdi3.S                   |    4 +---
 xen/arch/x86/acpi/boot.c                           |    3 +--
 xen/arch/x86/acpi/cpu_idle.c                       |    3 +--
 xen/arch/x86/acpi/cpufreq/cpufreq.c                |    3 +--
 xen/arch/x86/acpi/cpufreq/powernow.c               |    3 +--
 xen/arch/x86/acpi/cpuidle_menu.c                   |    3 +--
 xen/arch/x86/acpi/lib.c                            |    3 +--
 xen/arch/x86/alternative.c                         |    3 +--
 xen/arch/x86/cpu/mcheck/amd_nonfatal.c             |    3 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c                 |    3 +--
 xen/arch/x86/cpu/mcheck/mce_amd.c                  |    3 +--
 xen/arch/x86/cpu/mcheck/mce_quirks.h               |    3 +--
 xen/arch/x86/cpu/mcheck/vmce.c                     |    3 +--
 xen/arch/x86/cpu/mcheck/x86_mca.h                  |    3 +--
 xen/arch/x86/cpu/mtrr/main.c                       |    3 +--
 xen/arch/x86/cpu/mwait-idle.c                      |    3 +--
 xen/arch/x86/cpu/vpmu.c                            |    3 +--
 xen/arch/x86/cpu/vpmu_amd.c                        |    3 +--
 xen/arch/x86/cpu/vpmu_intel.c                      |    3 +--
 xen/arch/x86/debug.c                               |    4 +---
 xen/arch/x86/gdbstub.c                             |    3 +--
 xen/arch/x86/genapic/x2apic.c                      |    3 +--
 xen/arch/x86/hvm/asid.c                            |    3 +--
 xen/arch/x86/hvm/event.c                           |    3 +--
 xen/arch/x86/hvm/hpet.c                            |    3 +--
 xen/arch/x86/hvm/hvm.c                             |    3 +--
 xen/arch/x86/hvm/intercept.c                       |    3 +--
 xen/arch/x86/hvm/io.c                              |    3 +--
 xen/arch/x86/hvm/irq.c                             |    3 +--
 xen/arch/x86/hvm/mtrr.c                            |    3 +--
 xen/arch/x86/hvm/nestedhvm.c                       |    3 +--
 xen/arch/x86/hvm/pmtimer.c                         |    3 +--
 xen/arch/x86/hvm/quirks.c                          |    3 +--
 xen/arch/x86/hvm/save.c                            |    3 +--
 xen/arch/x86/hvm/svm/asid.c                        |    3 +--
 xen/arch/x86/hvm/svm/emulate.c                     |    3 +--
 xen/arch/x86/hvm/svm/entry.S                       |    3 +--
 xen/arch/x86/hvm/svm/intr.c                        |    3 +--
 xen/arch/x86/hvm/svm/nestedsvm.c                   |    3 +--
 xen/arch/x86/hvm/svm/svm.c                         |    3 +--
 xen/arch/x86/hvm/svm/svmdebug.c                    |    3 +--
 xen/arch/x86/hvm/svm/vmcb.c                        |    3 +--
 xen/arch/x86/hvm/vioapic.c                         |    3 +--
 xen/arch/x86/hvm/vlapic.c                          |    3 +--
 xen/arch/x86/hvm/vmsi.c                            |    3 +--
 xen/arch/x86/hvm/vmx/entry.S                       |    3 +--
 xen/arch/x86/hvm/vmx/intr.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmcs.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmx.c                         |    3 +--
 xen/arch/x86/hvm/vmx/vvmx.c                        |    3 +--
 xen/arch/x86/hvm/vpt.c                             |    3 +--
 xen/arch/x86/mm.c                                  |    3 +--
 xen/arch/x86/mm/altp2m.c                           |    3 +--
 xen/arch/x86/mm/guest_walk.c                       |    3 +--
 xen/arch/x86/mm/hap/guest_walk.c                   |    3 +--
 xen/arch/x86/mm/hap/hap.c                          |    3 +--
 xen/arch/x86/mm/hap/nested_ept.c                   |    3 +--
 xen/arch/x86/mm/hap/nested_hap.c                   |    3 +--
 xen/arch/x86/mm/hap/private.h                      |    3 +--
 xen/arch/x86/mm/mem_paging.c                       |    3 +--
 xen/arch/x86/mm/mem_sharing.c                      |    3 +--
 xen/arch/x86/mm/mm-locks.h                         |    3 +--
 xen/arch/x86/mm/p2m-ept.c                          |    3 +--
 xen/arch/x86/mm/p2m-pod.c                          |    3 +--
 xen/arch/x86/mm/p2m-pt.c                           |    3 +--
 xen/arch/x86/mm/p2m.c                              |    3 +--
 xen/arch/x86/mm/paging.c                           |    3 +--
 xen/arch/x86/mm/shadow/common.c                    |    3 +--
 xen/arch/x86/mm/shadow/multi.c                     |    3 +--
 xen/arch/x86/mm/shadow/multi.h                     |    3 +--
 xen/arch/x86/mm/shadow/private.h                   |    3 +--
 xen/arch/x86/mm/shadow/types.h                     |    3 +--
 xen/arch/x86/monitor.c                             |    4 +---
 xen/arch/x86/smpboot.c                             |    3 +--
 xen/arch/x86/traps.c                               |    3 +--
 xen/arch/x86/vm_event.c                            |    4 +---
 xen/arch/x86/x86_64/acpi_mmcfg.c                   |    3 +--
 xen/arch/x86/x86_64/cpu_idle.c                     |    3 +--
 xen/arch/x86/x86_64/cpufreq.c                      |    3 +--
 xen/arch/x86/x86_64/gdbstub.c                      |    3 +--
 xen/arch/x86/x86_64/mm.c                           |    3 +--
 xen/arch/x86/x86_64/mmconfig.h                     |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.c             |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.h             |    3 +--
 xen/common/event_channel.c                         |    3 +--
 xen/common/gdbstub.c                               |    3 +--
 xen/common/grant_table.c                           |    3 +--
 xen/common/hvm/save.c                              |    3 +--
 xen/common/libelf/libelf-dominfo.c                 |    3 +--
 xen/common/libelf/libelf-loader.c                  |    3 +--
 xen/common/libelf/libelf-private.h                 |    3 +--
 xen/common/libelf/libelf-tools.c                   |    3 +--
 xen/common/libfdt/fdt.c                            |    4 +---
 xen/common/libfdt/fdt_empty_tree.c                 |    4 +---
 xen/common/libfdt/fdt_ro.c                         |    4 +---
 xen/common/libfdt/fdt_rw.c                         |    4 +---
 xen/common/libfdt/fdt_strerror.c                   |    4 +---
 xen/common/libfdt/fdt_sw.c                         |    4 +---
 xen/common/libfdt/fdt_wip.c                        |    4 +---
 xen/common/libfdt/libfdt_internal.h                |    4 +---
 xen/common/mem_access.c                            |    3 +--
 xen/common/page_alloc.c                            |    3 +--
 xen/common/pdx.c                                   |    3 +--
 xen/common/preempt.c                               |    3 +--
 xen/common/radix-tree.c                            |    3 +--
 xen/common/rbtree.c                                |    3 +--
 xen/common/rcupdate.c                              |    3 +--
 xen/common/stop_machine.c                          |    3 +--
 xen/common/time.c                                  |    3 +--
 xen/common/unlzma.c                                |    3 +--
 xen/common/unlzo.c                                 |    3 +--
 xen/common/vm_event.c                              |    3 +--
 xen/common/wait.c                                  |    3 +--
 xen/drivers/acpi/apei/apei-base.c                  |    3 +--
 xen/drivers/acpi/apei/apei-io.c                    |    3 +--
 xen/drivers/acpi/apei/erst.c                       |    3 +--
 xen/drivers/acpi/apei/hest.c                       |    3 +--
 xen/drivers/acpi/numa.c                            |    3 +--
 xen/drivers/acpi/osl.c                             |    3 +--
 xen/drivers/acpi/pmstat.c                          |    3 +--
 xen/drivers/acpi/tables.c                          |    3 +--
 xen/drivers/cpufreq/cpufreq.c                      |    3 +--
 xen/drivers/passthrough/amd/iommu_acpi.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_cmd.c            |    3 +--
 xen/drivers/passthrough/amd/iommu_detect.c         |    3 +--
 xen/drivers/passthrough/amd/iommu_guest.c          |    3 +--
 xen/drivers/passthrough/amd/iommu_init.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_intr.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_map.c            |    3 +--
 xen/drivers/passthrough/amd/pci_amd_iommu.c        |    3 +--
 xen/drivers/passthrough/arm/smmu.c                 |    3 +--
 xen/drivers/passthrough/ats.h                      |    3 +--
 xen/drivers/passthrough/io.c                       |    3 +--
 xen/drivers/passthrough/iommu.c                    |    3 +--
 xen/drivers/passthrough/pci.c                      |    3 +--
 xen/drivers/passthrough/vtd/dmar.c                 |    3 +--
 xen/drivers/passthrough/vtd/dmar.h                 |    3 +--
 xen/drivers/passthrough/vtd/extern.h               |    3 +--
 xen/drivers/passthrough/vtd/intremap.c             |    3 +--
 xen/drivers/passthrough/vtd/iommu.c                |    3 +--
 xen/drivers/passthrough/vtd/iommu.h                |    3 +--
 xen/drivers/passthrough/vtd/qinval.c               |    3 +--
 xen/drivers/passthrough/vtd/quirks.c               |    3 +--
 xen/drivers/passthrough/vtd/utils.c                |    3 +--
 xen/drivers/passthrough/vtd/vtd.h                  |    3 +--
 xen/drivers/passthrough/vtd/x86/ats.c              |    3 +--
 xen/drivers/passthrough/vtd/x86/vtd.c              |    3 +--
 xen/drivers/passthrough/x86/ats.c                  |    3 +--
 xen/drivers/passthrough/x86/iommu.c                |    3 +--
 xen/include/asm-arm/iommu.h                        |    3 +--
 xen/include/asm-arm/monitor.h                      |    4 +---
 xen/include/asm-arm/vm_event.h                     |    3 +--
 xen/include/asm-x86/acpi.h                         |    3 +--
 xen/include/asm-x86/altp2m.h                       |    3 +--
 xen/include/asm-x86/amd-iommu.h                    |    3 +--
 xen/include/asm-x86/guest_pt.h                     |    3 +--
 xen/include/asm-x86/hap.h                          |    3 +--
 xen/include/asm-x86/hvm/asid.h                     |    3 +--
 xen/include/asm-x86/hvm/domain.h                   |    3 +--
 xen/include/asm-x86/hvm/event.h                    |    3 +--
 xen/include/asm-x86/hvm/hvm.h                      |    3 +--
 xen/include/asm-x86/hvm/io.h                       |    3 +--
 xen/include/asm-x86/hvm/irq.h                      |    3 +--
 xen/include/asm-x86/hvm/nestedhvm.h                |    3 +--
 xen/include/asm-x86/hvm/support.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h       |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h      |    3 +--
 xen/include/asm-x86/hvm/svm/asid.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/emulate.h              |    3 +--
 xen/include/asm-x86/hvm/svm/intr.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/nestedsvm.h            |    3 +--
 xen/include/asm-x86/hvm/svm/svm.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/svmdebug.h             |    3 +--
 xen/include/asm-x86/hvm/svm/vmcb.h                 |    3 +--
 xen/include/asm-x86/hvm/vcpu.h                     |    3 +--
 xen/include/asm-x86/hvm/vioapic.h                  |    3 +--
 xen/include/asm-x86/hvm/vlapic.h                   |    3 +--
 xen/include/asm-x86/hvm/vmx/vmcs.h                 |    3 +--
 xen/include/asm-x86/hvm/vmx/vmx.h                  |    3 +--
 xen/include/asm-x86/hvm/vmx/vvmx.h                 |    3 +--
 xen/include/asm-x86/hvm/vpt.h                      |    3 +--
 xen/include/asm-x86/iommu.h                        |    3 +--
 xen/include/asm-x86/mem_paging.h                   |    3 +--
 xen/include/asm-x86/mem_sharing.h                  |    3 +--
 xen/include/asm-x86/monitor.h                      |    4 +---
 xen/include/asm-x86/p2m.h                          |    3 +--
 xen/include/asm-x86/paging.h                       |    3 +--
 xen/include/asm-x86/shadow.h                       |    3 +--
 xen/include/asm-x86/traps.h                        |    3 +--
 xen/include/asm-x86/vm_event.h                     |    3 +--
 xen/include/asm-x86/vpmu.h                         |    3 +--
 xen/include/asm-x86/xenoprof.h                     |    3 +--
 xen/include/public/io/libxenvchan.h                |    3 +--
 xen/include/xen/acpi.h                             |    3 +--
 xen/include/xen/cper.h                             |    3 +--
 xen/include/xen/cpuidle.h                          |    3 +--
 xen/include/xen/gdbstub.h                          |    3 +--
 xen/include/xen/grant_table.h                      |    3 +--
 xen/include/xen/hvm/iommu.h                        |    3 +--
 xen/include/xen/hvm/irq.h                          |    3 +--
 xen/include/xen/hvm/save.h                         |    3 +--
 xen/include/xen/inttypes.h                         |    4 +---
 xen/include/xen/iommu.h                            |    3 +--
 xen/include/xen/libfdt/fdt.h                       |    4 +---
 xen/include/xen/libfdt/libfdt.h                    |    4 +---
 xen/include/xen/mem_access.h                       |    3 +--
 xen/include/xen/multiboot.h                        |    3 +--
 xen/include/xen/radix-tree.h                       |    3 +--
 xen/include/xen/rbtree.h                           |    3 +--
 xen/include/xen/rcupdate.h                         |    3 +--
 xen/include/xen/vm_event.h                         |    3 +--
 472 files changed, 474 insertions(+), 978 deletions(-)

diff --git a/COPYING b/COPYING
index 07535ad..acd3016 100644
--- a/COPYING
+++ b/COPYING
@@ -343,8 +343,7 @@ the "copyright" line and a pointer to where the full notice is found.
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 
 Also add information on how to contact you by electronic and paper mail.
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index 62995f0..ed7182d 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -14,8 +14,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
diff --git a/m4/systemd.m4 b/m4/systemd.m4
index b04964b..8284993 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -13,8 +13,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 dnl Some optional path options
 AC_DEFUN([AX_SYSTEMD_OPTIONS], [
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
index 2a2fa36..b18a5a3 100644
--- a/stubdom/vtpmmgr/tpmrsa.c
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -19,8 +19,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
index 31e5a8b..08213bb 100644
--- a/stubdom/vtpmmgr/tpmrsa.h
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -21,8 +21,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef TPMRSA_H
 #define TPMRSA_H
diff --git a/tools/blktap2/drivers/libaio-compat.h b/tools/blktap2/drivers/libaio-compat.h
index 47cd96d..ca9ff45 100644
--- a/tools/blktap2/drivers/libaio-compat.h
+++ b/tools/blktap2/drivers/libaio-compat.h
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should  have received a copy  of the GNU  Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/configure b/tools/configure
index d90db47..9cb01ae 100755
--- a/tools/configure
+++ b/tools/configure
@@ -3595,8 +3595,7 @@ esac
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -3805,8 +3804,7 @@ esac
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+# along with this program; If not, see <http://www.gnu.org/licenses/>.
 
 
 
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index ff9ac7d..f130a60 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <sys/file.h>
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index e246c25..cafc7b7 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #define _GNU_SOURCE
diff --git a/tools/console/daemon/io.h b/tools/console/daemon/io.h
index f658bfc..d016add 100644
--- a/tools/console/daemon/io.h
+++ b/tools/console/daemon/io.h
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #ifndef CONSOLED_IO_H
diff --git a/tools/console/daemon/main.c b/tools/console/daemon/main.c
index 11de5c9..23860d3 100644
--- a/tools/console/daemon/main.c
+++ b/tools/console/daemon/main.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <getopt.h>
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 71dd185..dbb3b12 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #include <sys/types.h>
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
index 8725dcd..1295822 100644
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  * 
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
 \*/
 
 #ifndef CONSOLED_UTILS_H
diff --git a/tools/debugger/gdbsx/gx/gx.h b/tools/debugger/gdbsx/gx/gx.h
index 47594c3..af39575 100644
--- a/tools/debugger/gdbsx/gx/gx.h
+++ b/tools/debugger/gdbsx/gx/gx.h
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 typedef uint16_t domid_t;
diff --git a/tools/debugger/gdbsx/gx/gx_comm.c b/tools/debugger/gdbsx/gx/gx_comm.c
index 7680dbd..5a0c61d 100644
--- a/tools/debugger/gdbsx/gx/gx_comm.c
+++ b/tools/debugger/gdbsx/gx/gx_comm.c
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program; If not, see <http://www.gnu.org/licenses/>.  */
 /*
  * Copyright (C) 2009, Mukesh Rathor, Oracle Corp.  All rights reserved.
  *
@@ -31,9 +29,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This module handles communication with remote gdb.  courtesy 
diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
index c8f0e72..1bec03d 100644
--- a/tools/debugger/gdbsx/gx/gx_local.c
+++ b/tools/debugger/gdbsx/gx/gx_local.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 
diff --git a/tools/debugger/gdbsx/gx/gx_main.c b/tools/debugger/gdbsx/gx/gx_main.c
index e3feee1..a908c45 100644
--- a/tools/debugger/gdbsx/gx/gx_main.c
+++ b/tools/debugger/gdbsx/gx/gx_main.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This module is the main module for gdbsx implementation. gdbsx is a remote
diff --git a/tools/debugger/gdbsx/gx/gx_utils.c b/tools/debugger/gdbsx/gx/gx_utils.c
index e87ffcb..f3c0039 100644
--- a/tools/debugger/gdbsx/gx/gx_utils.c
+++ b/tools/debugger/gdbsx/gx/gx_utils.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdio.h>
diff --git a/tools/debugger/gdbsx/gx/xg_dummy.c b/tools/debugger/gdbsx/gx/xg_dummy.c
index b82899f..e995fad 100644
--- a/tools/debugger/gdbsx/gx/xg_dummy.c
+++ b/tools/debugger/gdbsx/gx/xg_dummy.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdio.h>
 #include <stddef.h>
diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index c95e4ed..8c8a402 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* This is the main module to interface with xen. This module exports APIs that
diff --git a/tools/debugger/gdbsx/xg/xg_public.h b/tools/debugger/gdbsx/xg/xg_public.h
index 6236d08..3f905a2 100644
--- a/tools/debugger/gdbsx/xg/xg_public.h
+++ b/tools/debugger/gdbsx/xg/xg_public.h
@@ -11,9 +11,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #define XGERR(...)   \
diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index fe770a3..1141350 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -17,8 +17,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <inttypes.h>
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 76773b8..0560a7b 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -14,8 +14,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 XEN_ROOT = $(CURDIR)/../../..
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index 33b714a..d3e882a 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -11,8 +11,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 XEN_ROOT = $(CURDIR)/../../../..
diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h b/tools/firmware/hvmloader/acpi/acpi2_0.h
index d698095..78eb43d 100644
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h
@@ -11,8 +11,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 #ifndef _ACPI_2_0_H_
diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index 3276df2..503648c 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -12,8 +12,7 @@
  * details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "acpi2_0.h"
diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index fc1f309..e266dc2 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_pm.asl b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
index 48e6d05..1a7d752 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_pm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
@@ -15,8 +15,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s3.asl b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
index dad1db5..f89ac02 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_s3.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("SSDT_S3.aml", "SSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s4.asl b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
index 0a84381..d589e4b 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_s4.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 DefinitionBlock ("SSDT_S4.aml", "SSDT", 2, "Xen", "HVM", 0)
diff --git a/tools/firmware/hvmloader/acpi/ssdt_tpm.asl b/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
index 1157eb4..2ae8ad4 100644
--- a/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_tpm.asl
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* SSDT for TPM TIS Interface for Xen with Qemu device model. */
diff --git a/tools/firmware/hvmloader/acpi/static_tables.c b/tools/firmware/hvmloader/acpi/static_tables.c
index 323ae31..f4d627b 100644
--- a/tools/firmware/hvmloader/acpi/static_tables.c
+++ b/tools/firmware/hvmloader/acpi/static_tables.c
@@ -12,8 +12,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "acpi2_0.h"
diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index de8d39c..1ac6656 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index f4ccacb..bbde2be 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 84c588c..716d03c 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/mkhex b/tools/firmware/hvmloader/mkhex
index cb21257..d0982d5 100755
--- a/tools/firmware/hvmloader/mkhex
+++ b/tools/firmware/hvmloader/mkhex
@@ -16,8 +16,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 echo "unsigned $1[] = {"
diff --git a/tools/firmware/hvmloader/mp_tables.c b/tools/firmware/hvmloader/mp_tables.c
index fd636a0..69c2885 100644
--- a/tools/firmware/hvmloader/mp_tables.c
+++ b/tools/firmware/hvmloader/mp_tables.c
@@ -24,8 +24,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdint.h>
diff --git a/tools/firmware/hvmloader/optionroms.c b/tools/firmware/hvmloader/optionroms.c
index e35aebc..9708058 100644
--- a/tools/firmware/hvmloader/optionroms.c
+++ b/tools/firmware/hvmloader/optionroms.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index 28dd7bc..bb3da93 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -18,8 +18,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 69b98d6..4eb1a31 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/pir_types.h b/tools/firmware/hvmloader/pir_types.h
index 6e50822..9f9259c 100644
--- a/tools/firmware/hvmloader/pir_types.h
+++ b/tools/firmware/hvmloader/pir_types.h
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) Citrix Systems, 2011
  *
diff --git a/tools/firmware/hvmloader/rombios.c b/tools/firmware/hvmloader/rombios.c
index 810bd24..1f15b94 100644
--- a/tools/firmware/hvmloader/rombios.c
+++ b/tools/firmware/hvmloader/rombios.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/seabios.c b/tools/firmware/hvmloader/seabios.c
index dd7dfbe..c6b3d9f 100644
--- a/tools/firmware/hvmloader/seabios.c
+++ b/tools/firmware/hvmloader/seabios.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/smbios.c
index 4d3d692..210c7b0 100644
--- a/tools/firmware/hvmloader/smbios.c
+++ b/tools/firmware/hvmloader/smbios.c
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/hvmloader/smbios_types.h b/tools/firmware/hvmloader/smbios_types.h
index ff36564..e924f81 100644
--- a/tools/firmware/hvmloader/smbios_types.h
+++ b/tools/firmware/hvmloader/smbios_types.h
@@ -12,8 +12,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/hvmloader/smp.c b/tools/firmware/hvmloader/smp.c
index fa96878..082b17f 100644
--- a/tools/firmware/hvmloader/smp.c
+++ b/tools/firmware/hvmloader/smp.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/tests.c b/tools/firmware/hvmloader/tests.c
index 52772aa..fea3ad3 100644
--- a/tools/firmware/hvmloader/tests.c
+++ b/tools/firmware/hvmloader/tests.c
@@ -16,8 +16,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 32ddcd0..d779fd7 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -14,8 +14,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "util.h"
diff --git a/tools/firmware/rombios/32bit/32bitbios.c b/tools/firmware/rombios/32bit/32bitbios.c
index 22f83f4..87acf20 100644
--- a/tools/firmware/rombios/32bit/32bitbios.c
+++ b/tools/firmware/rombios/32bit/32bitbios.c
@@ -12,8 +12,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/mkhex b/tools/firmware/rombios/32bit/mkhex
index 4517e36..7200d00 100644
--- a/tools/firmware/rombios/32bit/mkhex
+++ b/tools/firmware/rombios/32bit/mkhex
@@ -16,8 +16,7 @@
 # more details.
 #
 # You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307 USA.
+# this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 echo "unsigned $1[] = {"
diff --git a/tools/firmware/rombios/32bit/pmm.c b/tools/firmware/rombios/32bit/pmm.c
index 4a279ca..09fec42 100644
--- a/tools/firmware/rombios/32bit/pmm.c
+++ b/tools/firmware/rombios/32bit/pmm.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  *  Copyright (C) 2009 FUJITSU LIMITED
  *
diff --git a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
index 01d4f2f..beef5a4 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c b/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
index d45f9b0..59d16bb 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
@@ -14,8 +14,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/rombios/32bit/util.c b/tools/firmware/rombios/32bit/util.c
index a47bb71..e473e89 100644
--- a/tools/firmware/rombios/32bit/util.c
+++ b/tools/firmware/rombios/32bit/util.c
@@ -14,8 +14,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdarg.h>
 #include <stdint.h>
diff --git a/tools/firmware/rombios/32bitgateway.c b/tools/firmware/rombios/32bitgateway.c
index fc82e07..3d58a6b 100644
--- a/tools/firmware/rombios/32bitgateway.c
+++ b/tools/firmware/rombios/32bitgateway.c
@@ -15,8 +15,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  * Copyright (c) 2008, Citrix Systems, Inc.
diff --git a/tools/firmware/rombios/apmbios.S b/tools/firmware/rombios/apmbios.S
index a010949..814be8f 100644
--- a/tools/firmware/rombios/apmbios.S
+++ b/tools/firmware/rombios/apmbios.S
@@ -15,8 +15,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 #if defined(APM_REAL)
 #define APMSYM(s) apmreal_ ## s
diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c
index 057aced..58ace9b 100644
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -21,8 +21,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 // ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
 
diff --git a/tools/firmware/rombios/rombios.h b/tools/firmware/rombios/rombios.h
index 0308a18..8726d37 100644
--- a/tools/firmware/rombios/rombios.h
+++ b/tools/firmware/rombios/rombios.h
@@ -15,8 +15,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 /* define it to include QEMU specific code */
 //#define BX_QEMU
diff --git a/tools/firmware/rombios/tcgbios.c b/tools/firmware/rombios/tcgbios.c
index c7ec261..e725ef9 100644
--- a/tools/firmware/rombios/tcgbios.c
+++ b/tools/firmware/rombios/tcgbios.c
@@ -13,8 +13,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) IBM Corporation, 2006
  *
diff --git a/tools/firmware/vgabios/COPYING b/tools/firmware/vgabios/COPYING
index 223ede7..0595626 100644
--- a/tools/firmware/vgabios/COPYING
+++ b/tools/firmware/vgabios/COPYING
@@ -484,8 +484,7 @@ convey the exclusion of warranty; and each file should have at least the
     Lesser General Public License for more details.
 
     You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    License along with this library; If not, see <http://www.gnu.org/licenses/>.
 
 Also add information on how to contact you by electronic and paper mail.
 
diff --git a/tools/firmware/vgabios/biossums.c b/tools/firmware/vgabios/biossums.c
index 6288498..85ecc04 100644
--- a/tools/firmware/vgabios/biossums.c
+++ b/tools/firmware/vgabios/biossums.c
@@ -12,8 +12,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tools/firmware/vgabios/clext.c b/tools/firmware/vgabios/clext.c
index c501227..d727cd5 100644
--- a/tools/firmware/vgabios/clext.c
+++ b/tools/firmware/vgabios/clext.c
@@ -14,8 +14,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 
 //#define CIRRUS_VESA3_PMINFO
diff --git a/tools/firmware/vgabios/vbe.c b/tools/firmware/vgabios/vbe.c
index a13e223..c506690 100644
--- a/tools/firmware/vgabios/vbe.c
+++ b/tools/firmware/vgabios/vbe.c
@@ -13,8 +13,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 // ============================================================================================
 //  
diff --git a/tools/firmware/vgabios/vgabios.c b/tools/firmware/vgabios/vgabios.c
index a9dbe00..1c75b7d 100644
--- a/tools/firmware/vgabios/vgabios.c
+++ b/tools/firmware/vgabios/vgabios.c
@@ -17,8 +17,7 @@
 //  Lesser General Public License for more details.
 //
 //  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  License along with this library; If not, see <http://www.gnu.org/licenses/>.
 // 
 // ============================================================================================
 //  
diff --git a/tools/hotplug/Linux/block-common.sh b/tools/hotplug/Linux/block-common.sh
index cc374ef..ee95009 100644
--- a/tools/hotplug/Linux/block-common.sh
+++ b/tools/hotplug/Linux/block-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/block-drbd-probe b/tools/hotplug/Linux/block-drbd-probe
index 247a9d0..635d9f9 100755
--- a/tools/hotplug/Linux/block-drbd-probe
+++ b/tools/hotplug/Linux/block-drbd-probe
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 # Usage:
 #     block-drbd-probe devicename
diff --git a/tools/hotplug/Linux/external-device-migrate b/tools/hotplug/Linux/external-device-migrate
index a411348..f5942a6 100644
--- a/tools/hotplug/Linux/external-device-migrate
+++ b/tools/hotplug/Linux/external-device-migrate
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -x
diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index 122bcfb..c6a7e96 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -12,8 +12,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 #
diff --git a/tools/hotplug/Linux/logging.sh b/tools/hotplug/Linux/logging.sh
index c1bc699..3e94df1 100644
--- a/tools/hotplug/Linux/logging.sh
+++ b/tools/hotplug/Linux/logging.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 log() {
diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh
index fa0a18e..6e8d584 100644
--- a/tools/hotplug/Linux/vif-common.sh
+++ b/tools/hotplug/Linux/vif-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh.in b/tools/hotplug/Linux/xen-hotplug-common.sh.in
index afb240f..d5d0b69 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh.in
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 dir=$(dirname "$0")
diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh
index 3c63c55..92ffa60 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/hotplug/Linux/xen-script-common.sh b/tools/hotplug/Linux/xen-script-common.sh
index f6841ac..370a50a 100644
--- a/tools/hotplug/Linux/xen-script-common.sh
+++ b/tools/hotplug/Linux/xen-script-common.sh
@@ -11,8 +11,7 @@
 # Lesser General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# License along with this library; If not, see <http://www.gnu.org/licenses/>.
 #
 
 
diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index 75c4cbe..ba53ff4 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/fat/fat.h b/tools/libfsimage/fat/fat.h
index f72b72a..2abb430 100644
--- a/tools/libfsimage/fat/fat.h
+++ b/tools/libfsimage/fat/fat.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 
diff --git a/tools/libfsimage/fat/fsys_fat.c b/tools/libfsimage/fat/fsys_fat.c
index d22d243..b8129a8 100644
--- a/tools/libfsimage/fat/fsys_fat.c
+++ b/tools/libfsimage/fat/fsys_fat.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <limits.h>
diff --git a/tools/libfsimage/iso9660/fsys_iso9660.c b/tools/libfsimage/iso9660/fsys_iso9660.c
index b991cfc..5dbf100 100644
--- a/tools/libfsimage/iso9660/fsys_iso9660.c
+++ b/tools/libfsimage/iso9660/fsys_iso9660.c
@@ -15,8 +15,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  References:
diff --git a/tools/libfsimage/iso9660/iso9660.h b/tools/libfsimage/iso9660/iso9660.h
index 83d0019..4ea9b3e 100644
--- a/tools/libfsimage/iso9660/iso9660.h
+++ b/tools/libfsimage/iso9660/iso9660.h
@@ -15,8 +15,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  *  References:
diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 4aa9bfb..92c3b2b 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/ufs/fsys_ufs.c b/tools/libfsimage/ufs/fsys_ufs.c
index be51411..cf7e22a 100644
--- a/tools/libfsimage/ufs/fsys_ufs.c
+++ b/tools/libfsimage/ufs/fsys_ufs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/xfs/fsys_xfs.c b/tools/libfsimage/xfs/fsys_xfs.c
index 0261a52..f39d096 100644
--- a/tools/libfsimage/xfs/fsys_xfs.c
+++ b/tools/libfsimage/xfs/fsys_xfs.c
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <fsimage_grub.h>
diff --git a/tools/libfsimage/xfs/xfs.h b/tools/libfsimage/xfs/xfs.h
index 02f8dcd..4069928 100644
--- a/tools/libfsimage/xfs/xfs.h
+++ b/tools/libfsimage/xfs/xfs.h
@@ -20,8 +20,7 @@
  *  other software, or any other product whatsoever.
  * 
  *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write the Free Software Foundation, Inc., 59
- *  Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *  with this program; If not, see <http://www.gnu.org/licenses/>.
  * 
  *  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  *  Mountain View, CA  94043, or:
diff --git a/tools/libfsimage/zfs/Makefile b/tools/libfsimage/zfs/Makefile
index 9fb0aab..4b9f131 100644
--- a/tools/libfsimage/zfs/Makefile
+++ b/tools/libfsimage/zfs/Makefile
@@ -13,8 +13,7 @@
 #  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#  along with this program; If not, see <http://www.gnu.org/licenses/>.
 #
 
 # 
diff --git a/tools/libfsimage/zfs/filesys.h b/tools/libfsimage/zfs/filesys.h
index 1fae8e8..36cc720 100644
--- a/tools/libfsimage/zfs/filesys.h
+++ b/tools/libfsimage/zfs/filesys.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsi_zfs.c b/tools/libfsimage/zfs/fsi_zfs.c
index 05148bc..7514587 100644
--- a/tools/libfsimage/zfs/fsi_zfs.c
+++ b/tools/libfsimage/zfs/fsi_zfs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsi_zfs.h b/tools/libfsimage/zfs/fsi_zfs.h
index c849147..fb4dc23 100644
--- a/tools/libfsimage/zfs/fsi_zfs.h
+++ b/tools/libfsimage/zfs/fsi_zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsys_zfs.c b/tools/libfsimage/zfs/fsys_zfs.c
index 863232b..e881fbb 100644
--- a/tools/libfsimage/zfs/fsys_zfs.c
+++ b/tools/libfsimage/zfs/fsys_zfs.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/fsys_zfs.h b/tools/libfsimage/zfs/fsys_zfs.h
index 36aa1e7..5cd627d 100644
--- a/tools/libfsimage/zfs/fsys_zfs.h
+++ b/tools/libfsimage/zfs/fsys_zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/mb_info.h b/tools/libfsimage/zfs/mb_info.h
index 1e1e63b..16e9013 100644
--- a/tools/libfsimage/zfs/mb_info.h
+++ b/tools/libfsimage/zfs/mb_info.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libfsimage/zfs/shared.h b/tools/libfsimage/zfs/shared.h
index 0bf6751..e4a239a 100644
--- a/tools/libfsimage/zfs/shared.h
+++ b/tools/libfsimage/zfs/shared.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dmu.h b/tools/libfsimage/zfs/zfs-include/dmu.h
index 7faa708..b39a951 100644
--- a/tools/libfsimage/zfs/zfs-include/dmu.h
+++ b/tools/libfsimage/zfs/zfs-include/dmu.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dmu_objset.h b/tools/libfsimage/zfs/zfs-include/dmu_objset.h
index 8d1cf8e..2680fcf 100644
--- a/tools/libfsimage/zfs/zfs-include/dmu_objset.h
+++ b/tools/libfsimage/zfs/zfs-include/dmu_objset.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dnode.h b/tools/libfsimage/zfs/zfs-include/dnode.h
index 5f6e4bb..dd90a87 100644
--- a/tools/libfsimage/zfs/zfs-include/dnode.h
+++ b/tools/libfsimage/zfs/zfs-include/dnode.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dsl_dataset.h b/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
index a8c60c4..470b607 100644
--- a/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
+++ b/tools/libfsimage/zfs/zfs-include/dsl_dataset.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/dsl_dir.h b/tools/libfsimage/zfs/zfs-include/dsl_dir.h
index 591e197..0e71b6b 100644
--- a/tools/libfsimage/zfs/zfs-include/dsl_dir.h
+++ b/tools/libfsimage/zfs/zfs-include/dsl_dir.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/sa_impl.h b/tools/libfsimage/zfs/zfs-include/sa_impl.h
index 4d93558..0679c93 100644
--- a/tools/libfsimage/zfs/zfs-include/sa_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/sa_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/spa.h b/tools/libfsimage/zfs/zfs-include/spa.h
index 4c943310..ee708ef 100644
--- a/tools/libfsimage/zfs/zfs-include/spa.h
+++ b/tools/libfsimage/zfs/zfs-include/spa.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/uberblock_impl.h b/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
index 9e70ac0..282d3b9 100644
--- a/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/uberblock_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/vdev_impl.h b/tools/libfsimage/zfs/zfs-include/vdev_impl.h
index ba427dd..f3823b2 100644
--- a/tools/libfsimage/zfs/zfs-include/vdev_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/vdev_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zap_impl.h b/tools/libfsimage/zfs/zfs-include/zap_impl.h
index ebb57a6..7adfc34 100644
--- a/tools/libfsimage/zfs/zfs-include/zap_impl.h
+++ b/tools/libfsimage/zfs/zfs-include/zap_impl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zap_leaf.h b/tools/libfsimage/zfs/zfs-include/zap_leaf.h
index 4ff3515..ecf3faa 100644
--- a/tools/libfsimage/zfs/zfs-include/zap_leaf.h
+++ b/tools/libfsimage/zfs/zfs-include/zap_leaf.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs.h b/tools/libfsimage/zfs/zfs-include/zfs.h
index c0887d5..592d23a 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs_acl.h b/tools/libfsimage/zfs/zfs-include/zfs_acl.h
index 77ebb8d..6a685e0 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs_acl.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs_acl.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zfs_znode.h b/tools/libfsimage/zfs/zfs-include/zfs_znode.h
index ea37c08..902c497 100644
--- a/tools/libfsimage/zfs/zfs-include/zfs_znode.h
+++ b/tools/libfsimage/zfs/zfs-include/zfs_znode.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zil.h b/tools/libfsimage/zfs/zfs-include/zil.h
index 87c1dc5..f34173c 100644
--- a/tools/libfsimage/zfs/zfs-include/zil.h
+++ b/tools/libfsimage/zfs/zfs-include/zil.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zio.h b/tools/libfsimage/zfs/zfs-include/zio.h
index 298017a..513f321 100644
--- a/tools/libfsimage/zfs/zfs-include/zio.h
+++ b/tools/libfsimage/zfs/zfs-include/zio.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs-include/zio_checksum.h b/tools/libfsimage/zfs/zfs-include/zio_checksum.h
index 28ba792..5f22f29 100644
--- a/tools/libfsimage/zfs/zfs-include/zio_checksum.h
+++ b/tools/libfsimage/zfs/zfs-include/zio_checksum.h
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_fletcher.c b/tools/libfsimage/zfs/zfs_fletcher.c
index 34a034e..cc9e8c4 100644
--- a/tools/libfsimage/zfs/zfs_fletcher.c
+++ b/tools/libfsimage/zfs/zfs_fletcher.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_lzjb.c b/tools/libfsimage/zfs/zfs_lzjb.c
index c617362..0b11eee 100644
--- a/tools/libfsimage/zfs/zfs_lzjb.c
+++ b/tools/libfsimage/zfs/zfs_lzjb.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libfsimage/zfs/zfs_sha256.c b/tools/libfsimage/zfs/zfs_sha256.c
index 393eaee..616fc0a 100644
--- a/tools/libfsimage/zfs/zfs_sha256.c
+++ b/tools/libfsimage/zfs/zfs_sha256.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index de10817..77be4e7 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index e66bc4e..8a9629b 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 6365d36..0944a0e 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 6712df0..0394644 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libvchan/node.c b/tools/libvchan/node.c
index cab8368..f1638f0 100644
--- a/tools/libvchan/node.c
+++ b/tools/libvchan/node.c
@@ -21,8 +21,7 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *  License along with this program; If not, see <http://www.gnu.org/licenses/>.
  *
  * @section DESCRIPTION
  *
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index a7d059a..600aef6 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <xen/libelf/libelf.h>
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index ac7e5fd..de3c0ad 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -19,8 +19,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENCTRL_H
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index e97944b..5121d9b 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index f837bde..1a1a185 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENGUEST_H
diff --git a/tools/libxc/include/xentoollog.h b/tools/libxc/include/xentoollog.h
index 85d3da9..853e9c7 100644
--- a/tools/libxc/include/xentoollog.h
+++ b/tools/libxc/include/xentoollog.h
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XENTOOLLOG_H
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
index 0f3c5ed..87a0fdf 100644
--- a/tools/libxc/xc_altp2m.c
+++ b/tools/libxc/xc_altp2m.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_compression.c b/tools/libxc/xc_compression.c
index d42e651..b1b16e8 100644
--- a/tools/libxc/xc_compression.c
+++ b/tools/libxc/xc_compression.c
@@ -22,8 +22,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index dfa424b..011336c 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 5867030..ffbe490 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 57d4715..d8570fd 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011 Citrix Systems
  *
diff --git a/tools/libxc/xc_core_arm.h b/tools/libxc/xc_core_arm.h
index 24781eb..162f7a7 100644
--- a/tools/libxc/xc_core_arm.h
+++ b/tools/libxc/xc_core_arm.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2012 Citrix Systems
  *
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index 93ebcbb..679e753 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
  *                    VA Linux Systems Japan K.K.
diff --git a/tools/libxc/xc_core_x86.h b/tools/libxc/xc_core_x86.h
index d5e04e7..867146b 100644
--- a/tools/libxc/xc_core_x86.h
+++ b/tools/libxc/xc_core_x86.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
  *                    VA Linux Systems Japan K.K.
diff --git a/tools/libxc/xc_cpu_hotplug.c b/tools/libxc/xc_cpu_hotplug.c
index e4659c0..58c2a0f 100644
--- a/tools/libxc/xc_cpu_hotplug.c
+++ b/tools/libxc/xc_cpu_hotplug.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index 66cc82e..c3ddc80 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef __LIBXC_CPUFEATURE_H
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index c97f91a..e146a3e 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdlib.h>
diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index 828f234..c42273e 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2009, J Gross.
  */
diff --git a/tools/libxc/xc_csched.c b/tools/libxc/xc_csched.c
index 390c645..bf03bfc 100644
--- a/tools/libxc/xc_csched.c
+++ b/tools/libxc/xc_csched.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_csched2.c b/tools/libxc/xc_csched2.c
index 6da6a46..ed99605 100644
--- a/tools/libxc/xc_csched2.c
+++ b/tools/libxc/xc_csched2.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 065debb..b00d667 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xc_dom_armzimageloader.c
index 2b28781..0df8c2a 100644
--- a/tools/libxc/xc_dom_armzimageloader.c
+++ b/tools/libxc/xc_dom_armzimageloader.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index e1de5b5..740601a 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Some of the field descriptions were copied from "The Multiboot
  * Specification", Copyright 1995, 96 Bryan Ford <baford@cs.utah.edu>,
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f82db2d..8e06406 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 3bb17dd..7fde42a 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -18,8 +18,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  * written 2007 by Jeremy Fitzhardinge <jeremy@xensource.com>
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 617cd96..a3abb99 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index b100ce1..8466677 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 6ce1062..66ea9d6 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 6a04399..3d40fa4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -16,8 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * written 2006 by Gerd Hoffmann <kraxel@suse.de>.
  *
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 582b0ae..2ee26fb 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2003, K A Fraser.
  */
diff --git a/tools/libxc/xc_efi.h b/tools/libxc/xc_efi.h
index 734da98..dbe105b 100644
--- a/tools/libxc/xc_efi.h
+++ b/tools/libxc/xc_efi.h
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) 1999 VA Linux Systems
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
diff --git a/tools/libxc/xc_elf.h b/tools/libxc/xc_elf.h
index cb616d6..acbc028 100644
--- a/tools/libxc/xc_elf.h
+++ b/tools/libxc/xc_elf.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <xen/libelf/elfstructs.h>
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 2e0679e..15f0580 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2004, K A Fraser.
  */
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index e24a2e7..b533656 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 43abf01..f42d140 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_freebsd.c b/tools/libxc/xc_freebsd.c
index 8e70a91..9dd48a3 100644
--- a/tools/libxc/xc_freebsd.c
+++ b/tools/libxc/xc_freebsd.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 011112b..4d31a1e 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 4076e47..60335d8 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -13,8 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 932b47c..6e3c958 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdlib.h>
diff --git a/tools/libxc/xc_hvm_build_arm.c b/tools/libxc/xc_hvm_build_arm.c
index ff66689..14f7c45 100644
--- a/tools/libxc/xc_hvm_build_arm.c
+++ b/tools/libxc/xc_hvm_build_arm.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index a6e9203..ec11f15 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -12,8 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stddef.h>
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 6121d80..c67c71c 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 2687424..e375428 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
index 5cfa611..3634c39 100644
--- a/tools/libxc/xc_mem_access.c
+++ b/tools/libxc/xc_mem_access.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_mem_paging.c b/tools/libxc/xc_mem_paging.c
index 4aa48d6..28611f4 100644
--- a/tools/libxc/xc_mem_paging.c
+++ b/tools/libxc/xc_mem_paging.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c
index 0960c6d..deb0aa4 100644
--- a/tools/libxc/xc_memshr.c
+++ b/tools/libxc/xc_memshr.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e703684..4f6498f 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -15,8 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #undef NDEBUG
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index b827bbb..c613545 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_bitops.h"
diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
index d5f87da..065669c 100644
--- a/tools/libxc/xc_monitor.c
+++ b/tools/libxc/xc_monitor.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 8a90ef3..54f1d7b 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 76978a0..902429e 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (c) 2011, Citrix Systems
  */
diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index c2a8230..7bb522f 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <inttypes.h>
diff --git a/tools/libxc/xc_pagetab.c b/tools/libxc/xc_pagetab.c
index 8525967..ec97890 100644
--- a/tools/libxc/xc_pagetab.c
+++ b/tools/libxc/xc_pagetab.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index 9b064b8..23108d6 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -17,8 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c
index 5a7148e..5b38cf1 100644
--- a/tools/libxc/xc_pm.c
+++ b/tools/libxc/xc_pm.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 2ffebd9..7c39897 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 247a408..2df1d59 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef XC_PRIVATE_H
diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
index e67bebd..87d4324 100644
--- a/tools/libxc/xc_resume.c
+++ b/tools/libxc/xc_resume.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index b2d1cc5..d59e5ce 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -19,8 +19,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7257a54..7e5d847 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "xc_private.h"
diff --git a/tools/libxc/xc_suspend.c b/tools/libxc/xc_suspend.c
index e22f4ac..bba36e7 100644
--- a/tools/libxc/xc_suspend.c
+++ b/tools/libxc/xc_suspend.c
@@ -10,8 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <unistd.h>
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index a4de491..695939a 100644
--- a/tools/libxc/xc_tbuf.c

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

From xen-changelog-bounces@lists.xen.org Fri Jul 31 13:49:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgf-0008UO-13; Fri, 31 Jul 2015 13:49:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgd-0008U6-8P
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:23 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	4B/41-32615-2EC7BB55; Fri, 31 Jul 2015 13:49:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350560!25024757!1
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 10672 invoked from network); 31 Jul 2015 13:49:20 -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;
	31 Jul 2015 13:49:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgZ-0004iv-UZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgZ-0007hW-TP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:19 +0000
Date: Fri, 31 Jul 2015 13:49:19 +0000
Message-Id: <E1ZLAgZ-0007hW-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'fsf-address-v1' of
	git://xenbits.xen.org/people/ianc/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 598fbeb9c1bd7b32a3c435913a382911cd68319b
Merge: 62fe12e12ed0e96f8eca00c535f87fb79fc5ccc0 443701ef0c7ff30872e27419cf4356fb6bdb4059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jul 30 15:31:18 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 15:31:18 2015 +0100

    Merge branch 'fsf-address-v1' of git://xenbits.xen.org/people/ianc/xen into staging

 COPYING                                            |    3 +--
 m4/pkg.m4                                          |    3 +--
 m4/systemd.m4                                      |    3 +--
 stubdom/grub.patches/10graphics.diff               |   10 ++++------
 stubdom/grub.patches/61btrfs.diff                  |    6 ++----
 stubdom/vtpmmgr/tpmrsa.c                           |    3 +--
 stubdom/vtpmmgr/tpmrsa.h                           |    3 +--
 tools/blktap2/drivers/libaio-compat.h              |    4 +---
 tools/configure                                    |    6 ++----
 tools/console/client/main.c                        |    3 +--
 tools/console/daemon/io.c                          |    3 +--
 tools/console/daemon/io.h                          |    3 +--
 tools/console/daemon/main.c                        |    3 +--
 tools/console/daemon/utils.c                       |    3 +--
 tools/console/daemon/utils.h                       |    3 +--
 tools/debugger/gdbsx/gx/gx.h                       |    4 +---
 tools/debugger/gdbsx/gx/gx_comm.c                  |    8 ++------
 tools/debugger/gdbsx/gx/gx_local.c                 |    4 +---
 tools/debugger/gdbsx/gx/gx_main.c                  |    4 +---
 tools/debugger/gdbsx/gx/gx_utils.c                 |    4 +---
 tools/debugger/gdbsx/gx/xg_dummy.c                 |    4 +---
 tools/debugger/gdbsx/xg/xg_main.c                  |    4 +---
 tools/debugger/gdbsx/xg/xg_public.h                |    4 +---
 tools/firmware/hvmloader/32bitbios_support.c       |    3 +--
 tools/firmware/hvmloader/Makefile                  |    3 +--
 tools/firmware/hvmloader/acpi/Makefile             |    3 +--
 tools/firmware/hvmloader/acpi/acpi2_0.h            |    3 +--
 tools/firmware/hvmloader/acpi/build.c              |    3 +--
 tools/firmware/hvmloader/acpi/dsdt.asl             |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_pm.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s3.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s4.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_tpm.asl         |    3 +--
 tools/firmware/hvmloader/acpi/static_tables.c      |    3 +--
 tools/firmware/hvmloader/cacheattr.c               |    3 +--
 tools/firmware/hvmloader/e820.c                    |    3 +--
 tools/firmware/hvmloader/hvmloader.c               |    3 +--
 tools/firmware/hvmloader/mkhex                     |    3 +--
 tools/firmware/hvmloader/mp_tables.c               |    3 +--
 tools/firmware/hvmloader/optionroms.c              |    3 +--
 tools/firmware/hvmloader/ovmf.c                    |    3 +--
 tools/firmware/hvmloader/pci.c                     |    3 +--
 tools/firmware/hvmloader/pir_types.h               |    3 +--
 tools/firmware/hvmloader/rombios.c                 |    3 +--
 tools/firmware/hvmloader/seabios.c                 |    3 +--
 tools/firmware/hvmloader/smbios.c                  |    3 +--
 tools/firmware/hvmloader/smbios_types.h            |    3 +--
 tools/firmware/hvmloader/smp.c                     |    3 +--
 tools/firmware/hvmloader/tests.c                   |    3 +--
 tools/firmware/hvmloader/util.c                    |    3 +--
 tools/firmware/rombios/32bit/32bitbios.c           |    3 +--
 tools/firmware/rombios/32bit/mkhex                 |    3 +--
 tools/firmware/rombios/32bit/pmm.c                 |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c     |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c |    3 +--
 tools/firmware/rombios/32bit/util.c                |    3 +--
 tools/firmware/rombios/32bitgateway.c              |    3 +--
 tools/firmware/rombios/apmbios.S                   |    3 +--
 tools/firmware/rombios/rombios.c                   |    3 +--
 tools/firmware/rombios/rombios.h                   |    3 +--
 tools/firmware/rombios/tcgbios.c                   |    3 +--
 tools/firmware/vgabios/COPYING                     |    3 +--
 tools/firmware/vgabios/biossums.c                  |    3 +--
 tools/firmware/vgabios/clext.c                     |    3 +--
 tools/firmware/vgabios/vbe.c                       |    3 +--
 tools/firmware/vgabios/vgabios.c                   |    3 +--
 tools/hotplug/Linux/block-common.sh                |    3 +--
 tools/hotplug/Linux/block-drbd-probe               |    3 +--
 tools/hotplug/Linux/external-device-migrate        |    3 +--
 tools/hotplug/Linux/locking.sh                     |    3 +--
 tools/hotplug/Linux/logging.sh                     |    3 +--
 tools/hotplug/Linux/vif-common.sh                  |    3 +--
 tools/hotplug/Linux/xen-hotplug-common.sh.in       |    3 +--
 tools/hotplug/Linux/xen-network-common.sh          |    3 +--
 tools/hotplug/Linux/xen-script-common.sh           |    3 +--
 tools/libfsimage/ext2fs/fsys_ext2fs.c              |    3 +--
 tools/libfsimage/fat/fat.h                         |    3 +--
 tools/libfsimage/fat/fsys_fat.c                    |    3 +--
 tools/libfsimage/iso9660/fsys_iso9660.c            |    3 +--
 tools/libfsimage/iso9660/iso9660.h                 |    3 +--
 tools/libfsimage/reiserfs/fsys_reiserfs.c          |    3 +--
 tools/libfsimage/ufs/fsys_ufs.c                    |    3 +--
 tools/libfsimage/xfs/fsys_xfs.c                    |    3 +--
 tools/libfsimage/xfs/xfs.h                         |    3 +--
 tools/libfsimage/zfs/Makefile                      |    3 +--
 tools/libfsimage/zfs/filesys.h                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.c                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.h                     |    3 +--
 tools/libfsimage/zfs/fsys_zfs.c                    |    3 +--
 tools/libfsimage/zfs/fsys_zfs.h                    |    3 +--
 tools/libfsimage/zfs/mb_info.h                     |    3 +--
 tools/libfsimage/zfs/shared.h                      |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu_objset.h      |    3 +--
 tools/libfsimage/zfs/zfs-include/dnode.h           |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dataset.h     |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dir.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/sa_impl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/spa.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/uberblock_impl.h  |    3 +--
 tools/libfsimage/zfs/zfs-include/vdev_impl.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_impl.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_leaf.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_acl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_znode.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zil.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio_checksum.h    |    3 +--
 tools/libfsimage/zfs/zfs_fletcher.c                |    3 +--
 tools/libfsimage/zfs/zfs_lzjb.c                    |    3 +--
 tools/libfsimage/zfs/zfs_sha256.c                  |    3 +--
 tools/libvchan/init.c                              |    3 +--
 tools/libvchan/io.c                                |    3 +--
 tools/libvchan/libxenvchan.h                       |    3 +--
 tools/libvchan/node-select.c                       |    3 +--
 tools/libvchan/node.c                              |    3 +--
 tools/libxc/include/xc_dom.h                       |    3 +--
 tools/libxc/include/xenctrl.h                      |    3 +--
 tools/libxc/include/xenctrlosdep.h                 |    3 +--
 tools/libxc/include/xenguest.h                     |    3 +--
 tools/libxc/include/xentoollog.h                   |    3 +--
 tools/libxc/xc_altp2m.c                            |    3 +--
 tools/libxc/xc_compression.c                       |    3 +--
 tools/libxc/xc_core.c                              |    3 +--
 tools/libxc/xc_core.h                              |    3 +--
 tools/libxc/xc_core_arm.c                          |    3 +--
 tools/libxc/xc_core_arm.h                          |    3 +--
 tools/libxc/xc_core_x86.c                          |    3 +--
 tools/libxc/xc_core_x86.h                          |    3 +--
 tools/libxc/xc_cpu_hotplug.c                       |    3 +--
 tools/libxc/xc_cpufeature.h                        |    3 +--
 tools/libxc/xc_cpuid_x86.c                         |    3 +--
 tools/libxc/xc_cpupool.c                           |    3 +--
 tools/libxc/xc_csched.c                            |    3 +--
 tools/libxc/xc_csched2.c                           |    3 +--
 tools/libxc/xc_dom_arm.c                           |    3 +--
 tools/libxc/xc_dom_armzimageloader.c               |    3 +--
 tools/libxc/xc_dom_binloader.c                     |    3 +--
 tools/libxc/xc_dom_boot.c                          |    3 +--
 tools/libxc/xc_dom_bzimageloader.c                 |    3 +--
 tools/libxc/xc_dom_compat_linux.c                  |    3 +--
 tools/libxc/xc_dom_core.c                          |    3 +--
 tools/libxc/xc_dom_elfloader.c                     |    3 +--
 tools/libxc/xc_dom_x86.c                           |    3 +--
 tools/libxc/xc_domain.c                            |    3 +--
 tools/libxc/xc_efi.h                               |    3 +--
 tools/libxc/xc_elf.h                               |    3 +--
 tools/libxc/xc_evtchn.c                            |    3 +--
 tools/libxc/xc_flask.c                             |    3 +--
 tools/libxc/xc_foreign_memory.c                    |    3 +--
 tools/libxc/xc_freebsd.c                           |    3 +--
 tools/libxc/xc_freebsd_osdep.c                     |    3 +--
 tools/libxc/xc_gnttab.c                            |    3 +--
 tools/libxc/xc_hcall_buf.c                         |    3 +--
 tools/libxc/xc_hvm_build_arm.c                     |    3 +--
 tools/libxc/xc_hvm_build_x86.c                     |    3 +--
 tools/libxc/xc_linux.c                             |    3 +--
 tools/libxc/xc_linux_osdep.c                       |    3 +--
 tools/libxc/xc_mem_access.c                        |    3 +--
 tools/libxc/xc_mem_paging.c                        |    3 +--
 tools/libxc/xc_memshr.c                            |    3 +--
 tools/libxc/xc_minios.c                            |    3 +--
 tools/libxc/xc_misc.c                              |    3 +--
 tools/libxc/xc_monitor.c                           |    3 +--
 tools/libxc/xc_netbsd.c                            |    3 +--
 tools/libxc/xc_nomigrate.c                         |    3 +--
 tools/libxc/xc_offline_page.c                      |    3 +--
 tools/libxc/xc_pagetab.c                           |    3 +--
 tools/libxc/xc_physdev.c                           |    3 +--
 tools/libxc/xc_pm.c                                |    3 +--
 tools/libxc/xc_private.c                           |    3 +--
 tools/libxc/xc_private.h                           |    3 +--
 tools/libxc/xc_resume.c                            |    3 +--
 tools/libxc/xc_rt.c                                |    3 +--
 tools/libxc/xc_solaris.c                           |    3 +--
 tools/libxc/xc_suspend.c                           |    3 +--
 tools/libxc/xc_tbuf.c                              |    3 +--
 tools/libxc/xc_tmem.c                              |    3 +--
 tools/libxc/xc_vm_event.c                          |    3 +--
 tools/libxc/xg_private.c                           |    3 +--
 tools/libxc/xg_private.h                           |    3 +--
 tools/libxc/xg_save_restore.h                      |    3 +--
 tools/libxc/xtl_core.c                             |    3 +--
 tools/libxc/xtl_logger_stdio.c                     |    3 +--
 tools/memshr/bidir-daemon.c                        |    3 +--
 tools/memshr/bidir-daemon.h                        |    3 +--
 tools/memshr/bidir-hash.c                          |    3 +--
 tools/memshr/bidir-hash.h                          |    3 +--
 tools/memshr/bidir-namedefs.h                      |    3 +--
 tools/memshr/interface.c                           |    3 +--
 tools/memshr/memshr-priv.h                         |    3 +--
 tools/memshr/memshr.h                              |    3 +--
 tools/memshr/shm.c                                 |    3 +--
 tools/memshr/shm.h                                 |    3 +--
 tools/misc/gtracestat.c                            |    3 +--
 tools/misc/gtraceview.c                            |    3 +--
 tools/misc/xen-ringwatch                           |    4 +---
 tools/misc/xencov.c                                |    3 +--
 tools/misc/xencov_split                            |    3 +--
 tools/misc/xenpm.c                                 |    3 +--
 tools/misc/xenpvnetboot                            |    4 +---
 tools/ocaml/LICENSE                                |    3 +--
 tools/pygrub/src/ExtLinuxConf.py                   |    3 +--
 tools/pygrub/src/GrubConf.py                       |    3 +--
 tools/pygrub/src/pygrub                            |    3 +--
 tools/python/xen/lowlevel/xl/xl.c                  |    3 +--
 tools/python/xen/lowlevel/xs/xs.c                  |    3 +--
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/config/setup.conf             |    3 +--
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        |    3 +--
 tools/tests/mce-test/tools/xen-mceinj.c            |    3 +--
 tools/tests/utests/run_all_tests.py                |    3 +--
 tools/tests/x86_emulator/blowfish.c                |    3 +--
 tools/xenbackendd/xenbackendd.c                    |    3 +--
 tools/xenmon/COPYING                               |    3 +--
 tools/xenmon/setmask.c                             |    3 +--
 tools/xenmon/xenbaked.c                            |    3 +--
 tools/xenmon/xenbaked.h                            |    3 +--
 tools/xenmon/xenmon.py                             |    3 +--
 tools/xenpaging/file_ops.c                         |    3 +--
 tools/xenpaging/file_ops.h                         |    3 +--
 tools/xenpaging/policy.h                           |    3 +--
 tools/xenpaging/policy_default.c                   |    3 +--
 tools/xenpaging/xenpaging.c                        |    3 +--
 tools/xenpaging/xenpaging.h                        |    3 +--
 tools/xenpmd/xenpmd.c                              |    3 +--
 tools/xenstat/libxenstat/COPYING                   |    3 +--
 tools/xenstat/xentop/xentop.1                      |    3 +--
 tools/xenstat/xentop/xentop.c                      |    3 +--
 tools/xenstore/COPYING                             |    3 +--
 tools/xenstore/include/xenstore.h                  |    3 +--
 tools/xenstore/include/xenstore_lib.h              |    3 +--
 tools/xenstore/talloc.c                            |    3 +--
 tools/xenstore/talloc.h                            |    3 +--
 tools/xenstore/tdb.c                               |    3 +--
 tools/xenstore/tdb.h                               |    3 +--
 tools/xenstore/xenstored_core.c                    |    3 +--
 tools/xenstore/xenstored_core.h                    |    3 +--
 tools/xenstore/xenstored_domain.c                  |    3 +--
 tools/xenstore/xenstored_domain.h                  |    3 +--
 tools/xenstore/xenstored_minios.c                  |    3 +--
 tools/xenstore/xenstored_posix.c                   |    3 +--
 tools/xenstore/xenstored_transaction.c             |    3 +--
 tools/xenstore/xenstored_transaction.h             |    3 +--
 tools/xenstore/xenstored_watch.c                   |    3 +--
 tools/xenstore/xenstored_watch.h                   |    3 +--
 tools/xenstore/xs.c                                |    3 +--
 tools/xenstore/xs_lib.c                            |    3 +--
 tools/xentrace/xenalyze.c                          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.c          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.h          |    3 +--
 .../linux-2.6/platform-pci/xen_support.c           |    3 +--
 xen/COPYING                                        |    3 +--
 xen/arch/arm/arm32/lib/lib1funcs.S                 |    4 +---
 xen/arch/arm/arm32/lib/lshrdi3.S                   |    4 +---
 xen/arch/x86/acpi/boot.c                           |    3 +--
 xen/arch/x86/acpi/cpu_idle.c                       |    3 +--
 xen/arch/x86/acpi/cpufreq/cpufreq.c                |    3 +--
 xen/arch/x86/acpi/cpufreq/powernow.c               |    3 +--
 xen/arch/x86/acpi/cpuidle_menu.c                   |    3 +--
 xen/arch/x86/acpi/lib.c                            |    3 +--
 xen/arch/x86/alternative.c                         |    3 +--
 xen/arch/x86/cpu/mcheck/amd_nonfatal.c             |    3 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c                 |    3 +--
 xen/arch/x86/cpu/mcheck/mce_amd.c                  |    3 +--
 xen/arch/x86/cpu/mcheck/mce_quirks.h               |    3 +--
 xen/arch/x86/cpu/mcheck/vmce.c                     |    3 +--
 xen/arch/x86/cpu/mcheck/x86_mca.h                  |    3 +--
 xen/arch/x86/cpu/mtrr/main.c                       |    3 +--
 xen/arch/x86/cpu/mwait-idle.c                      |    3 +--
 xen/arch/x86/cpu/vpmu.c                            |    3 +--
 xen/arch/x86/cpu/vpmu_amd.c                        |    3 +--
 xen/arch/x86/cpu/vpmu_intel.c                      |    3 +--
 xen/arch/x86/debug.c                               |    4 +---
 xen/arch/x86/gdbstub.c                             |    3 +--
 xen/arch/x86/genapic/x2apic.c                      |    3 +--
 xen/arch/x86/hvm/asid.c                            |    3 +--
 xen/arch/x86/hvm/event.c                           |    3 +--
 xen/arch/x86/hvm/hpet.c                            |    3 +--
 xen/arch/x86/hvm/hvm.c                             |    3 +--
 xen/arch/x86/hvm/intercept.c                       |    3 +--
 xen/arch/x86/hvm/io.c                              |    3 +--
 xen/arch/x86/hvm/irq.c                             |    3 +--
 xen/arch/x86/hvm/mtrr.c                            |    3 +--
 xen/arch/x86/hvm/nestedhvm.c                       |    3 +--
 xen/arch/x86/hvm/pmtimer.c                         |    3 +--
 xen/arch/x86/hvm/quirks.c                          |    3 +--
 xen/arch/x86/hvm/save.c                            |    3 +--
 xen/arch/x86/hvm/svm/asid.c                        |    3 +--
 xen/arch/x86/hvm/svm/emulate.c                     |    3 +--
 xen/arch/x86/hvm/svm/entry.S                       |    3 +--
 xen/arch/x86/hvm/svm/intr.c                        |    3 +--
 xen/arch/x86/hvm/svm/nestedsvm.c                   |    3 +--
 xen/arch/x86/hvm/svm/svm.c                         |    3 +--
 xen/arch/x86/hvm/svm/svmdebug.c                    |    3 +--
 xen/arch/x86/hvm/svm/vmcb.c                        |    3 +--
 xen/arch/x86/hvm/vioapic.c                         |    3 +--
 xen/arch/x86/hvm/vlapic.c                          |    3 +--
 xen/arch/x86/hvm/vmsi.c                            |    3 +--
 xen/arch/x86/hvm/vmx/entry.S                       |    3 +--
 xen/arch/x86/hvm/vmx/intr.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmcs.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmx.c                         |    3 +--
 xen/arch/x86/hvm/vmx/vvmx.c                        |    3 +--
 xen/arch/x86/hvm/vpt.c                             |    3 +--
 xen/arch/x86/mm.c                                  |    3 +--
 xen/arch/x86/mm/altp2m.c                           |    3 +--
 xen/arch/x86/mm/guest_walk.c                       |    3 +--
 xen/arch/x86/mm/hap/guest_walk.c                   |    3 +--
 xen/arch/x86/mm/hap/hap.c                          |    3 +--
 xen/arch/x86/mm/hap/nested_ept.c                   |    3 +--
 xen/arch/x86/mm/hap/nested_hap.c                   |    3 +--
 xen/arch/x86/mm/hap/private.h                      |    3 +--
 xen/arch/x86/mm/mem_paging.c                       |    3 +--
 xen/arch/x86/mm/mem_sharing.c                      |    3 +--
 xen/arch/x86/mm/mm-locks.h                         |    3 +--
 xen/arch/x86/mm/p2m-ept.c                          |    3 +--
 xen/arch/x86/mm/p2m-pod.c                          |    3 +--
 xen/arch/x86/mm/p2m-pt.c                           |    3 +--
 xen/arch/x86/mm/p2m.c                              |    3 +--
 xen/arch/x86/mm/paging.c                           |    3 +--
 xen/arch/x86/mm/shadow/common.c                    |    3 +--
 xen/arch/x86/mm/shadow/multi.c                     |    3 +--
 xen/arch/x86/mm/shadow/multi.h                     |    3 +--
 xen/arch/x86/mm/shadow/private.h                   |    3 +--
 xen/arch/x86/mm/shadow/types.h                     |    3 +--
 xen/arch/x86/monitor.c                             |    4 +---
 xen/arch/x86/smpboot.c                             |    3 +--
 xen/arch/x86/traps.c                               |    3 +--
 xen/arch/x86/vm_event.c                            |    4 +---
 xen/arch/x86/x86_64/acpi_mmcfg.c                   |    3 +--
 xen/arch/x86/x86_64/cpu_idle.c                     |    3 +--
 xen/arch/x86/x86_64/cpufreq.c                      |    3 +--
 xen/arch/x86/x86_64/gdbstub.c                      |    3 +--
 xen/arch/x86/x86_64/mm.c                           |    3 +--
 xen/arch/x86/x86_64/mmconfig.h                     |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.c             |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.h             |    3 +--
 xen/common/event_channel.c                         |    3 +--
 xen/common/gdbstub.c                               |    3 +--
 xen/common/grant_table.c                           |    3 +--
 xen/common/hvm/save.c                              |    3 +--
 xen/common/libelf/libelf-dominfo.c                 |    3 +--
 xen/common/libelf/libelf-loader.c                  |    3 +--
 xen/common/libelf/libelf-private.h                 |    3 +--
 xen/common/libelf/libelf-tools.c                   |    3 +--
 xen/common/libfdt/fdt.c                            |    4 +---
 xen/common/libfdt/fdt_empty_tree.c                 |    4 +---
 xen/common/libfdt/fdt_ro.c                         |    4 +---
 xen/common/libfdt/fdt_rw.c                         |    4 +---
 xen/common/libfdt/fdt_strerror.c                   |    4 +---
 xen/common/libfdt/fdt_sw.c                         |    4 +---
 xen/common/libfdt/fdt_wip.c                        |    4 +---
 xen/common/libfdt/libfdt_internal.h                |    4 +---
 xen/common/mem_access.c                            |    3 +--
 xen/common/page_alloc.c                            |    3 +--
 xen/common/pdx.c                                   |    3 +--
 xen/common/preempt.c                               |    3 +--
 xen/common/radix-tree.c                            |    3 +--
 xen/common/rbtree.c                                |    3 +--
 xen/common/rcupdate.c                              |    3 +--
 xen/common/stop_machine.c                          |    3 +--
 xen/common/time.c                                  |    3 +--
 xen/common/unlzma.c                                |    3 +--
 xen/common/unlzo.c                                 |    3 +--
 xen/common/vm_event.c                              |    3 +--
 xen/common/wait.c                                  |    3 +--
 xen/drivers/acpi/apei/apei-base.c                  |    3 +--
 xen/drivers/acpi/apei/apei-io.c                    |    3 +--
 xen/drivers/acpi/apei/erst.c                       |    3 +--
 xen/drivers/acpi/apei/hest.c                       |    3 +--
 xen/drivers/acpi/numa.c                            |    3 +--
 xen/drivers/acpi/osl.c                             |    3 +--
 xen/drivers/acpi/pmstat.c                          |    3 +--
 xen/drivers/acpi/tables.c                          |    3 +--
 xen/drivers/cpufreq/cpufreq.c                      |    3 +--
 xen/drivers/passthrough/amd/iommu_acpi.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_cmd.c            |    3 +--
 xen/drivers/passthrough/amd/iommu_detect.c         |    3 +--
 xen/drivers/passthrough/amd/iommu_guest.c          |    3 +--
 xen/drivers/passthrough/amd/iommu_init.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_intr.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_map.c            |    3 +--
 xen/drivers/passthrough/amd/pci_amd_iommu.c        |    3 +--
 xen/drivers/passthrough/arm/smmu.c                 |    3 +--
 xen/drivers/passthrough/ats.h                      |    3 +--
 xen/drivers/passthrough/io.c                       |    3 +--
 xen/drivers/passthrough/iommu.c                    |    3 +--
 xen/drivers/passthrough/pci.c                      |    3 +--
 xen/drivers/passthrough/vtd/dmar.c                 |    3 +--
 xen/drivers/passthrough/vtd/dmar.h                 |    3 +--
 xen/drivers/passthrough/vtd/extern.h               |    3 +--
 xen/drivers/passthrough/vtd/intremap.c             |    3 +--
 xen/drivers/passthrough/vtd/iommu.c                |    3 +--
 xen/drivers/passthrough/vtd/iommu.h                |    3 +--
 xen/drivers/passthrough/vtd/qinval.c               |    3 +--
 xen/drivers/passthrough/vtd/quirks.c               |    3 +--
 xen/drivers/passthrough/vtd/utils.c                |    3 +--
 xen/drivers/passthrough/vtd/vtd.h                  |    3 +--
 xen/drivers/passthrough/vtd/x86/ats.c              |    3 +--
 xen/drivers/passthrough/vtd/x86/vtd.c              |    3 +--
 xen/drivers/passthrough/x86/ats.c                  |    3 +--
 xen/drivers/passthrough/x86/iommu.c                |    3 +--
 xen/include/asm-arm/iommu.h                        |    3 +--
 xen/include/asm-arm/monitor.h                      |    4 +---
 xen/include/asm-arm/vm_event.h                     |    3 +--
 xen/include/asm-x86/acpi.h                         |    3 +--
 xen/include/asm-x86/altp2m.h                       |    3 +--
 xen/include/asm-x86/amd-iommu.h                    |    3 +--
 xen/include/asm-x86/guest_pt.h                     |    3 +--
 xen/include/asm-x86/hap.h                          |    3 +--
 xen/include/asm-x86/hvm/asid.h                     |    3 +--
 xen/include/asm-x86/hvm/domain.h                   |    3 +--
 xen/include/asm-x86/hvm/event.h                    |    3 +--
 xen/include/asm-x86/hvm/hvm.h                      |    3 +--
 xen/include/asm-x86/hvm/io.h                       |    3 +--
 xen/include/asm-x86/hvm/irq.h                      |    3 +--
 xen/include/asm-x86/hvm/nestedhvm.h                |    3 +--
 xen/include/asm-x86/hvm/support.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h       |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h      |    3 +--
 xen/include/asm-x86/hvm/svm/asid.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/emulate.h              |    3 +--
 xen/include/asm-x86/hvm/svm/intr.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/nestedsvm.h            |    3 +--
 xen/include/asm-x86/hvm/svm/svm.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/svmdebug.h             |    3 +--
 xen/include/asm-x86/hvm/svm/vmcb.h                 |    3 +--
 xen/include/asm-x86/hvm/vcpu.h                     |    3 +--
 xen/include/asm-x86/hvm/vioapic.h                  |    3 +--
 xen/include/asm-x86/hvm/vlapic.h                   |    3 +--
 xen/include/asm-x86/hvm/vmx/vmcs.h                 |    3 +--
 xen/include/asm-x86/hvm/vmx/vmx.h                  |    3 +--
 xen/include/asm-x86/hvm/vmx/vvmx.h                 |    3 +--
 xen/include/asm-x86/hvm/vpt.h                      |    3 +--
 xen/include/asm-x86/iommu.h                        |    3 +--
 xen/include/asm-x86/mem_paging.h                   |    3 +--
 xen/include/asm-x86/mem_sharing.h                  |    3 +--
 xen/include/asm-x86/monitor.h                      |    4 +---
 xen/include/asm-x86/p2m.h                          |    3 +--
 xen/include/asm-x86/paging.h                       |    3 +--
 xen/include/asm-x86/shadow.h                       |    3 +--
 xen/include/asm-x86/traps.h                        |    3 +--
 xen/include/asm-x86/vm_event.h                     |    3 +--
 xen/include/asm-x86/vpmu.h                         |    3 +--
 xen/include/asm-x86/xenoprof.h                     |    3 +--
 xen/include/public/io/libxenvchan.h                |    3 +--
 xen/include/xen/acpi.h                             |    3 +--
 xen/include/xen/cper.h                             |    3 +--
 xen/include/xen/cpuidle.h                          |    3 +--
 xen/include/xen/gdbstub.h                          |    3 +--
 xen/include/xen/grant_table.h                      |    3 +--
 xen/include/xen/hvm/iommu.h                        |    3 +--
 xen/include/xen/hvm/irq.h                          |    3 +--
 xen/include/xen/hvm/save.h                         |    3 +--
 xen/include/xen/inttypes.h                         |    4 +---
 xen/include/xen/iommu.h                            |    3 +--
 xen/include/xen/libfdt/fdt.h                       |    4 +---
 xen/include/xen/libfdt/libfdt.h                    |    4 +---
 xen/include/xen/mem_access.h                       |    3 +--
 xen/include/xen/multiboot.h                        |    3 +--
 xen/include/xen/radix-tree.h                       |    3 +--
 xen/include/xen/rbtree.h                           |    3 +--
 xen/include/xen/rcupdate.h                         |    3 +--
 xen/include/xen/vm_event.h                         |    3 +--
 474 files changed, 480 insertions(+), 988 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 Jul 31 13:49:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2015 13:49: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 1ZLAgf-0008UO-13; Fri, 31 Jul 2015 13:49:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgd-0008U6-8P
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:23 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	4B/41-32615-2EC7BB55; Fri, 31 Jul 2015 13:49:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1438350560!25024757!1
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 10672 invoked from network); 31 Jul 2015 13:49:20 -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;
	31 Jul 2015 13:49:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgZ-0004iv-UZ
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZLAgZ-0007hW-TP
	for xen-changelog@lists.xensource.com; Fri, 31 Jul 2015 13:49:19 +0000
Date: Fri, 31 Jul 2015 13:49:19 +0000
Message-Id: <E1ZLAgZ-0007hW-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'fsf-address-v1' of
	git://xenbits.xen.org/people/ianc/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 598fbeb9c1bd7b32a3c435913a382911cd68319b
Merge: 62fe12e12ed0e96f8eca00c535f87fb79fc5ccc0 443701ef0c7ff30872e27419cf4356fb6bdb4059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jul 30 15:31:18 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jul 30 15:31:18 2015 +0100

    Merge branch 'fsf-address-v1' of git://xenbits.xen.org/people/ianc/xen into staging

 COPYING                                            |    3 +--
 m4/pkg.m4                                          |    3 +--
 m4/systemd.m4                                      |    3 +--
 stubdom/grub.patches/10graphics.diff               |   10 ++++------
 stubdom/grub.patches/61btrfs.diff                  |    6 ++----
 stubdom/vtpmmgr/tpmrsa.c                           |    3 +--
 stubdom/vtpmmgr/tpmrsa.h                           |    3 +--
 tools/blktap2/drivers/libaio-compat.h              |    4 +---
 tools/configure                                    |    6 ++----
 tools/console/client/main.c                        |    3 +--
 tools/console/daemon/io.c                          |    3 +--
 tools/console/daemon/io.h                          |    3 +--
 tools/console/daemon/main.c                        |    3 +--
 tools/console/daemon/utils.c                       |    3 +--
 tools/console/daemon/utils.h                       |    3 +--
 tools/debugger/gdbsx/gx/gx.h                       |    4 +---
 tools/debugger/gdbsx/gx/gx_comm.c                  |    8 ++------
 tools/debugger/gdbsx/gx/gx_local.c                 |    4 +---
 tools/debugger/gdbsx/gx/gx_main.c                  |    4 +---
 tools/debugger/gdbsx/gx/gx_utils.c                 |    4 +---
 tools/debugger/gdbsx/gx/xg_dummy.c                 |    4 +---
 tools/debugger/gdbsx/xg/xg_main.c                  |    4 +---
 tools/debugger/gdbsx/xg/xg_public.h                |    4 +---
 tools/firmware/hvmloader/32bitbios_support.c       |    3 +--
 tools/firmware/hvmloader/Makefile                  |    3 +--
 tools/firmware/hvmloader/acpi/Makefile             |    3 +--
 tools/firmware/hvmloader/acpi/acpi2_0.h            |    3 +--
 tools/firmware/hvmloader/acpi/build.c              |    3 +--
 tools/firmware/hvmloader/acpi/dsdt.asl             |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_pm.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s3.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_s4.asl          |    3 +--
 tools/firmware/hvmloader/acpi/ssdt_tpm.asl         |    3 +--
 tools/firmware/hvmloader/acpi/static_tables.c      |    3 +--
 tools/firmware/hvmloader/cacheattr.c               |    3 +--
 tools/firmware/hvmloader/e820.c                    |    3 +--
 tools/firmware/hvmloader/hvmloader.c               |    3 +--
 tools/firmware/hvmloader/mkhex                     |    3 +--
 tools/firmware/hvmloader/mp_tables.c               |    3 +--
 tools/firmware/hvmloader/optionroms.c              |    3 +--
 tools/firmware/hvmloader/ovmf.c                    |    3 +--
 tools/firmware/hvmloader/pci.c                     |    3 +--
 tools/firmware/hvmloader/pir_types.h               |    3 +--
 tools/firmware/hvmloader/rombios.c                 |    3 +--
 tools/firmware/hvmloader/seabios.c                 |    3 +--
 tools/firmware/hvmloader/smbios.c                  |    3 +--
 tools/firmware/hvmloader/smbios_types.h            |    3 +--
 tools/firmware/hvmloader/smp.c                     |    3 +--
 tools/firmware/hvmloader/tests.c                   |    3 +--
 tools/firmware/hvmloader/util.c                    |    3 +--
 tools/firmware/rombios/32bit/32bitbios.c           |    3 +--
 tools/firmware/rombios/32bit/mkhex                 |    3 +--
 tools/firmware/rombios/32bit/pmm.c                 |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c     |    3 +--
 tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c |    3 +--
 tools/firmware/rombios/32bit/util.c                |    3 +--
 tools/firmware/rombios/32bitgateway.c              |    3 +--
 tools/firmware/rombios/apmbios.S                   |    3 +--
 tools/firmware/rombios/rombios.c                   |    3 +--
 tools/firmware/rombios/rombios.h                   |    3 +--
 tools/firmware/rombios/tcgbios.c                   |    3 +--
 tools/firmware/vgabios/COPYING                     |    3 +--
 tools/firmware/vgabios/biossums.c                  |    3 +--
 tools/firmware/vgabios/clext.c                     |    3 +--
 tools/firmware/vgabios/vbe.c                       |    3 +--
 tools/firmware/vgabios/vgabios.c                   |    3 +--
 tools/hotplug/Linux/block-common.sh                |    3 +--
 tools/hotplug/Linux/block-drbd-probe               |    3 +--
 tools/hotplug/Linux/external-device-migrate        |    3 +--
 tools/hotplug/Linux/locking.sh                     |    3 +--
 tools/hotplug/Linux/logging.sh                     |    3 +--
 tools/hotplug/Linux/vif-common.sh                  |    3 +--
 tools/hotplug/Linux/xen-hotplug-common.sh.in       |    3 +--
 tools/hotplug/Linux/xen-network-common.sh          |    3 +--
 tools/hotplug/Linux/xen-script-common.sh           |    3 +--
 tools/libfsimage/ext2fs/fsys_ext2fs.c              |    3 +--
 tools/libfsimage/fat/fat.h                         |    3 +--
 tools/libfsimage/fat/fsys_fat.c                    |    3 +--
 tools/libfsimage/iso9660/fsys_iso9660.c            |    3 +--
 tools/libfsimage/iso9660/iso9660.h                 |    3 +--
 tools/libfsimage/reiserfs/fsys_reiserfs.c          |    3 +--
 tools/libfsimage/ufs/fsys_ufs.c                    |    3 +--
 tools/libfsimage/xfs/fsys_xfs.c                    |    3 +--
 tools/libfsimage/xfs/xfs.h                         |    3 +--
 tools/libfsimage/zfs/Makefile                      |    3 +--
 tools/libfsimage/zfs/filesys.h                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.c                     |    3 +--
 tools/libfsimage/zfs/fsi_zfs.h                     |    3 +--
 tools/libfsimage/zfs/fsys_zfs.c                    |    3 +--
 tools/libfsimage/zfs/fsys_zfs.h                    |    3 +--
 tools/libfsimage/zfs/mb_info.h                     |    3 +--
 tools/libfsimage/zfs/shared.h                      |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/dmu_objset.h      |    3 +--
 tools/libfsimage/zfs/zfs-include/dnode.h           |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dataset.h     |    3 +--
 tools/libfsimage/zfs/zfs-include/dsl_dir.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/sa_impl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/spa.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/uberblock_impl.h  |    3 +--
 tools/libfsimage/zfs/zfs-include/vdev_impl.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_impl.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zap_leaf.h        |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_acl.h         |    3 +--
 tools/libfsimage/zfs/zfs-include/zfs_znode.h       |    3 +--
 tools/libfsimage/zfs/zfs-include/zil.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio.h             |    3 +--
 tools/libfsimage/zfs/zfs-include/zio_checksum.h    |    3 +--
 tools/libfsimage/zfs/zfs_fletcher.c                |    3 +--
 tools/libfsimage/zfs/zfs_lzjb.c                    |    3 +--
 tools/libfsimage/zfs/zfs_sha256.c                  |    3 +--
 tools/libvchan/init.c                              |    3 +--
 tools/libvchan/io.c                                |    3 +--
 tools/libvchan/libxenvchan.h                       |    3 +--
 tools/libvchan/node-select.c                       |    3 +--
 tools/libvchan/node.c                              |    3 +--
 tools/libxc/include/xc_dom.h                       |    3 +--
 tools/libxc/include/xenctrl.h                      |    3 +--
 tools/libxc/include/xenctrlosdep.h                 |    3 +--
 tools/libxc/include/xenguest.h                     |    3 +--
 tools/libxc/include/xentoollog.h                   |    3 +--
 tools/libxc/xc_altp2m.c                            |    3 +--
 tools/libxc/xc_compression.c                       |    3 +--
 tools/libxc/xc_core.c                              |    3 +--
 tools/libxc/xc_core.h                              |    3 +--
 tools/libxc/xc_core_arm.c                          |    3 +--
 tools/libxc/xc_core_arm.h                          |    3 +--
 tools/libxc/xc_core_x86.c                          |    3 +--
 tools/libxc/xc_core_x86.h                          |    3 +--
 tools/libxc/xc_cpu_hotplug.c                       |    3 +--
 tools/libxc/xc_cpufeature.h                        |    3 +--
 tools/libxc/xc_cpuid_x86.c                         |    3 +--
 tools/libxc/xc_cpupool.c                           |    3 +--
 tools/libxc/xc_csched.c                            |    3 +--
 tools/libxc/xc_csched2.c                           |    3 +--
 tools/libxc/xc_dom_arm.c                           |    3 +--
 tools/libxc/xc_dom_armzimageloader.c               |    3 +--
 tools/libxc/xc_dom_binloader.c                     |    3 +--
 tools/libxc/xc_dom_boot.c                          |    3 +--
 tools/libxc/xc_dom_bzimageloader.c                 |    3 +--
 tools/libxc/xc_dom_compat_linux.c                  |    3 +--
 tools/libxc/xc_dom_core.c                          |    3 +--
 tools/libxc/xc_dom_elfloader.c                     |    3 +--
 tools/libxc/xc_dom_x86.c                           |    3 +--
 tools/libxc/xc_domain.c                            |    3 +--
 tools/libxc/xc_efi.h                               |    3 +--
 tools/libxc/xc_elf.h                               |    3 +--
 tools/libxc/xc_evtchn.c                            |    3 +--
 tools/libxc/xc_flask.c                             |    3 +--
 tools/libxc/xc_foreign_memory.c                    |    3 +--
 tools/libxc/xc_freebsd.c                           |    3 +--
 tools/libxc/xc_freebsd_osdep.c                     |    3 +--
 tools/libxc/xc_gnttab.c                            |    3 +--
 tools/libxc/xc_hcall_buf.c                         |    3 +--
 tools/libxc/xc_hvm_build_arm.c                     |    3 +--
 tools/libxc/xc_hvm_build_x86.c                     |    3 +--
 tools/libxc/xc_linux.c                             |    3 +--
 tools/libxc/xc_linux_osdep.c                       |    3 +--
 tools/libxc/xc_mem_access.c                        |    3 +--
 tools/libxc/xc_mem_paging.c                        |    3 +--
 tools/libxc/xc_memshr.c                            |    3 +--
 tools/libxc/xc_minios.c                            |    3 +--
 tools/libxc/xc_misc.c                              |    3 +--
 tools/libxc/xc_monitor.c                           |    3 +--
 tools/libxc/xc_netbsd.c                            |    3 +--
 tools/libxc/xc_nomigrate.c                         |    3 +--
 tools/libxc/xc_offline_page.c                      |    3 +--
 tools/libxc/xc_pagetab.c                           |    3 +--
 tools/libxc/xc_physdev.c                           |    3 +--
 tools/libxc/xc_pm.c                                |    3 +--
 tools/libxc/xc_private.c                           |    3 +--
 tools/libxc/xc_private.h                           |    3 +--
 tools/libxc/xc_resume.c                            |    3 +--
 tools/libxc/xc_rt.c                                |    3 +--
 tools/libxc/xc_solaris.c                           |    3 +--
 tools/libxc/xc_suspend.c                           |    3 +--
 tools/libxc/xc_tbuf.c                              |    3 +--
 tools/libxc/xc_tmem.c                              |    3 +--
 tools/libxc/xc_vm_event.c                          |    3 +--
 tools/libxc/xg_private.c                           |    3 +--
 tools/libxc/xg_private.h                           |    3 +--
 tools/libxc/xg_save_restore.h                      |    3 +--
 tools/libxc/xtl_core.c                             |    3 +--
 tools/libxc/xtl_logger_stdio.c                     |    3 +--
 tools/memshr/bidir-daemon.c                        |    3 +--
 tools/memshr/bidir-daemon.h                        |    3 +--
 tools/memshr/bidir-hash.c                          |    3 +--
 tools/memshr/bidir-hash.h                          |    3 +--
 tools/memshr/bidir-namedefs.h                      |    3 +--
 tools/memshr/interface.c                           |    3 +--
 tools/memshr/memshr-priv.h                         |    3 +--
 tools/memshr/memshr.h                              |    3 +--
 tools/memshr/shm.c                                 |    3 +--
 tools/memshr/shm.h                                 |    3 +--
 tools/misc/gtracestat.c                            |    3 +--
 tools/misc/gtraceview.c                            |    3 +--
 tools/misc/xen-ringwatch                           |    4 +---
 tools/misc/xencov.c                                |    3 +--
 tools/misc/xencov_split                            |    3 +--
 tools/misc/xenpm.c                                 |    3 +--
 tools/misc/xenpvnetboot                            |    4 +---
 tools/ocaml/LICENSE                                |    3 +--
 tools/pygrub/src/ExtLinuxConf.py                   |    3 +--
 tools/pygrub/src/GrubConf.py                       |    3 +--
 tools/pygrub/src/pygrub                            |    3 +--
 tools/python/xen/lowlevel/xl/xl.c                  |    3 +--
 tools/python/xen/lowlevel/xs/xs.c                  |    3 +--
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |    3 +--
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |    3 +--
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |    3 +--
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |    3 +--
 tools/tests/mce-test/config/setup.conf             |    3 +--
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        |    3 +--
 tools/tests/mce-test/tools/xen-mceinj.c            |    3 +--
 tools/tests/utests/run_all_tests.py                |    3 +--
 tools/tests/x86_emulator/blowfish.c                |    3 +--
 tools/xenbackendd/xenbackendd.c                    |    3 +--
 tools/xenmon/COPYING                               |    3 +--
 tools/xenmon/setmask.c                             |    3 +--
 tools/xenmon/xenbaked.c                            |    3 +--
 tools/xenmon/xenbaked.h                            |    3 +--
 tools/xenmon/xenmon.py                             |    3 +--
 tools/xenpaging/file_ops.c                         |    3 +--
 tools/xenpaging/file_ops.h                         |    3 +--
 tools/xenpaging/policy.h                           |    3 +--
 tools/xenpaging/policy_default.c                   |    3 +--
 tools/xenpaging/xenpaging.c                        |    3 +--
 tools/xenpaging/xenpaging.h                        |    3 +--
 tools/xenpmd/xenpmd.c                              |    3 +--
 tools/xenstat/libxenstat/COPYING                   |    3 +--
 tools/xenstat/xentop/xentop.1                      |    3 +--
 tools/xenstat/xentop/xentop.c                      |    3 +--
 tools/xenstore/COPYING                             |    3 +--
 tools/xenstore/include/xenstore.h                  |    3 +--
 tools/xenstore/include/xenstore_lib.h              |    3 +--
 tools/xenstore/talloc.c                            |    3 +--
 tools/xenstore/talloc.h                            |    3 +--
 tools/xenstore/tdb.c                               |    3 +--
 tools/xenstore/tdb.h                               |    3 +--
 tools/xenstore/xenstored_core.c                    |    3 +--
 tools/xenstore/xenstored_core.h                    |    3 +--
 tools/xenstore/xenstored_domain.c                  |    3 +--
 tools/xenstore/xenstored_domain.h                  |    3 +--
 tools/xenstore/xenstored_minios.c                  |    3 +--
 tools/xenstore/xenstored_posix.c                   |    3 +--
 tools/xenstore/xenstored_transaction.c             |    3 +--
 tools/xenstore/xenstored_transaction.h             |    3 +--
 tools/xenstore/xenstored_watch.c                   |    3 +--
 tools/xenstore/xenstored_watch.h                   |    3 +--
 tools/xenstore/xs.c                                |    3 +--
 tools/xenstore/xs_lib.c                            |    3 +--
 tools/xentrace/xenalyze.c                          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.c          |    3 +--
 .../linux-2.6/platform-pci/platform-pci.h          |    3 +--
 .../linux-2.6/platform-pci/xen_support.c           |    3 +--
 xen/COPYING                                        |    3 +--
 xen/arch/arm/arm32/lib/lib1funcs.S                 |    4 +---
 xen/arch/arm/arm32/lib/lshrdi3.S                   |    4 +---
 xen/arch/x86/acpi/boot.c                           |    3 +--
 xen/arch/x86/acpi/cpu_idle.c                       |    3 +--
 xen/arch/x86/acpi/cpufreq/cpufreq.c                |    3 +--
 xen/arch/x86/acpi/cpufreq/powernow.c               |    3 +--
 xen/arch/x86/acpi/cpuidle_menu.c                   |    3 +--
 xen/arch/x86/acpi/lib.c                            |    3 +--
 xen/arch/x86/alternative.c                         |    3 +--
 xen/arch/x86/cpu/mcheck/amd_nonfatal.c             |    3 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c                 |    3 +--
 xen/arch/x86/cpu/mcheck/mce_amd.c                  |    3 +--
 xen/arch/x86/cpu/mcheck/mce_quirks.h               |    3 +--
 xen/arch/x86/cpu/mcheck/vmce.c                     |    3 +--
 xen/arch/x86/cpu/mcheck/x86_mca.h                  |    3 +--
 xen/arch/x86/cpu/mtrr/main.c                       |    3 +--
 xen/arch/x86/cpu/mwait-idle.c                      |    3 +--
 xen/arch/x86/cpu/vpmu.c                            |    3 +--
 xen/arch/x86/cpu/vpmu_amd.c                        |    3 +--
 xen/arch/x86/cpu/vpmu_intel.c                      |    3 +--
 xen/arch/x86/debug.c                               |    4 +---
 xen/arch/x86/gdbstub.c                             |    3 +--
 xen/arch/x86/genapic/x2apic.c                      |    3 +--
 xen/arch/x86/hvm/asid.c                            |    3 +--
 xen/arch/x86/hvm/event.c                           |    3 +--
 xen/arch/x86/hvm/hpet.c                            |    3 +--
 xen/arch/x86/hvm/hvm.c                             |    3 +--
 xen/arch/x86/hvm/intercept.c                       |    3 +--
 xen/arch/x86/hvm/io.c                              |    3 +--
 xen/arch/x86/hvm/irq.c                             |    3 +--
 xen/arch/x86/hvm/mtrr.c                            |    3 +--
 xen/arch/x86/hvm/nestedhvm.c                       |    3 +--
 xen/arch/x86/hvm/pmtimer.c                         |    3 +--
 xen/arch/x86/hvm/quirks.c                          |    3 +--
 xen/arch/x86/hvm/save.c                            |    3 +--
 xen/arch/x86/hvm/svm/asid.c                        |    3 +--
 xen/arch/x86/hvm/svm/emulate.c                     |    3 +--
 xen/arch/x86/hvm/svm/entry.S                       |    3 +--
 xen/arch/x86/hvm/svm/intr.c                        |    3 +--
 xen/arch/x86/hvm/svm/nestedsvm.c                   |    3 +--
 xen/arch/x86/hvm/svm/svm.c                         |    3 +--
 xen/arch/x86/hvm/svm/svmdebug.c                    |    3 +--
 xen/arch/x86/hvm/svm/vmcb.c                        |    3 +--
 xen/arch/x86/hvm/vioapic.c                         |    3 +--
 xen/arch/x86/hvm/vlapic.c                          |    3 +--
 xen/arch/x86/hvm/vmsi.c                            |    3 +--
 xen/arch/x86/hvm/vmx/entry.S                       |    3 +--
 xen/arch/x86/hvm/vmx/intr.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmcs.c                        |    3 +--
 xen/arch/x86/hvm/vmx/vmx.c                         |    3 +--
 xen/arch/x86/hvm/vmx/vvmx.c                        |    3 +--
 xen/arch/x86/hvm/vpt.c                             |    3 +--
 xen/arch/x86/mm.c                                  |    3 +--
 xen/arch/x86/mm/altp2m.c                           |    3 +--
 xen/arch/x86/mm/guest_walk.c                       |    3 +--
 xen/arch/x86/mm/hap/guest_walk.c                   |    3 +--
 xen/arch/x86/mm/hap/hap.c                          |    3 +--
 xen/arch/x86/mm/hap/nested_ept.c                   |    3 +--
 xen/arch/x86/mm/hap/nested_hap.c                   |    3 +--
 xen/arch/x86/mm/hap/private.h                      |    3 +--
 xen/arch/x86/mm/mem_paging.c                       |    3 +--
 xen/arch/x86/mm/mem_sharing.c                      |    3 +--
 xen/arch/x86/mm/mm-locks.h                         |    3 +--
 xen/arch/x86/mm/p2m-ept.c                          |    3 +--
 xen/arch/x86/mm/p2m-pod.c                          |    3 +--
 xen/arch/x86/mm/p2m-pt.c                           |    3 +--
 xen/arch/x86/mm/p2m.c                              |    3 +--
 xen/arch/x86/mm/paging.c                           |    3 +--
 xen/arch/x86/mm/shadow/common.c                    |    3 +--
 xen/arch/x86/mm/shadow/multi.c                     |    3 +--
 xen/arch/x86/mm/shadow/multi.h                     |    3 +--
 xen/arch/x86/mm/shadow/private.h                   |    3 +--
 xen/arch/x86/mm/shadow/types.h                     |    3 +--
 xen/arch/x86/monitor.c                             |    4 +---
 xen/arch/x86/smpboot.c                             |    3 +--
 xen/arch/x86/traps.c                               |    3 +--
 xen/arch/x86/vm_event.c                            |    4 +---
 xen/arch/x86/x86_64/acpi_mmcfg.c                   |    3 +--
 xen/arch/x86/x86_64/cpu_idle.c                     |    3 +--
 xen/arch/x86/x86_64/cpufreq.c                      |    3 +--
 xen/arch/x86/x86_64/gdbstub.c                      |    3 +--
 xen/arch/x86/x86_64/mm.c                           |    3 +--
 xen/arch/x86/x86_64/mmconfig.h                     |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.c             |    3 +--
 xen/arch/x86/x86_emulate/x86_emulate.h             |    3 +--
 xen/common/event_channel.c                         |    3 +--
 xen/common/gdbstub.c                               |    3 +--
 xen/common/grant_table.c                           |    3 +--
 xen/common/hvm/save.c                              |    3 +--
 xen/common/libelf/libelf-dominfo.c                 |    3 +--
 xen/common/libelf/libelf-loader.c                  |    3 +--
 xen/common/libelf/libelf-private.h                 |    3 +--
 xen/common/libelf/libelf-tools.c                   |    3 +--
 xen/common/libfdt/fdt.c                            |    4 +---
 xen/common/libfdt/fdt_empty_tree.c                 |    4 +---
 xen/common/libfdt/fdt_ro.c                         |    4 +---
 xen/common/libfdt/fdt_rw.c                         |    4 +---
 xen/common/libfdt/fdt_strerror.c                   |    4 +---
 xen/common/libfdt/fdt_sw.c                         |    4 +---
 xen/common/libfdt/fdt_wip.c                        |    4 +---
 xen/common/libfdt/libfdt_internal.h                |    4 +---
 xen/common/mem_access.c                            |    3 +--
 xen/common/page_alloc.c                            |    3 +--
 xen/common/pdx.c                                   |    3 +--
 xen/common/preempt.c                               |    3 +--
 xen/common/radix-tree.c                            |    3 +--
 xen/common/rbtree.c                                |    3 +--
 xen/common/rcupdate.c                              |    3 +--
 xen/common/stop_machine.c                          |    3 +--
 xen/common/time.c                                  |    3 +--
 xen/common/unlzma.c                                |    3 +--
 xen/common/unlzo.c                                 |    3 +--
 xen/common/vm_event.c                              |    3 +--
 xen/common/wait.c                                  |    3 +--
 xen/drivers/acpi/apei/apei-base.c                  |    3 +--
 xen/drivers/acpi/apei/apei-io.c                    |    3 +--
 xen/drivers/acpi/apei/erst.c                       |    3 +--
 xen/drivers/acpi/apei/hest.c                       |    3 +--
 xen/drivers/acpi/numa.c                            |    3 +--
 xen/drivers/acpi/osl.c                             |    3 +--
 xen/drivers/acpi/pmstat.c                          |    3 +--
 xen/drivers/acpi/tables.c                          |    3 +--
 xen/drivers/cpufreq/cpufreq.c                      |    3 +--
 xen/drivers/passthrough/amd/iommu_acpi.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_cmd.c            |    3 +--
 xen/drivers/passthrough/amd/iommu_detect.c         |    3 +--
 xen/drivers/passthrough/amd/iommu_guest.c          |    3 +--
 xen/drivers/passthrough/amd/iommu_init.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_intr.c           |    3 +--
 xen/drivers/passthrough/amd/iommu_map.c            |    3 +--
 xen/drivers/passthrough/amd/pci_amd_iommu.c        |    3 +--
 xen/drivers/passthrough/arm/smmu.c                 |    3 +--
 xen/drivers/passthrough/ats.h                      |    3 +--
 xen/drivers/passthrough/io.c                       |    3 +--
 xen/drivers/passthrough/iommu.c                    |    3 +--
 xen/drivers/passthrough/pci.c                      |    3 +--
 xen/drivers/passthrough/vtd/dmar.c                 |    3 +--
 xen/drivers/passthrough/vtd/dmar.h                 |    3 +--
 xen/drivers/passthrough/vtd/extern.h               |    3 +--
 xen/drivers/passthrough/vtd/intremap.c             |    3 +--
 xen/drivers/passthrough/vtd/iommu.c                |    3 +--
 xen/drivers/passthrough/vtd/iommu.h                |    3 +--
 xen/drivers/passthrough/vtd/qinval.c               |    3 +--
 xen/drivers/passthrough/vtd/quirks.c               |    3 +--
 xen/drivers/passthrough/vtd/utils.c                |    3 +--
 xen/drivers/passthrough/vtd/vtd.h                  |    3 +--
 xen/drivers/passthrough/vtd/x86/ats.c              |    3 +--
 xen/drivers/passthrough/vtd/x86/vtd.c              |    3 +--
 xen/drivers/passthrough/x86/ats.c                  |    3 +--
 xen/drivers/passthrough/x86/iommu.c                |    3 +--
 xen/include/asm-arm/iommu.h                        |    3 +--
 xen/include/asm-arm/monitor.h                      |    4 +---
 xen/include/asm-arm/vm_event.h                     |    3 +--
 xen/include/asm-x86/acpi.h                         |    3 +--
 xen/include/asm-x86/altp2m.h                       |    3 +--
 xen/include/asm-x86/amd-iommu.h                    |    3 +--
 xen/include/asm-x86/guest_pt.h                     |    3 +--
 xen/include/asm-x86/hap.h                          |    3 +--
 xen/include/asm-x86/hvm/asid.h                     |    3 +--
 xen/include/asm-x86/hvm/domain.h                   |    3 +--
 xen/include/asm-x86/hvm/event.h                    |    3 +--
 xen/include/asm-x86/hvm/hvm.h                      |    3 +--
 xen/include/asm-x86/hvm/io.h                       |    3 +--
 xen/include/asm-x86/hvm/irq.h                      |    3 +--
 xen/include/asm-x86/hvm/nestedhvm.h                |    3 +--
 xen/include/asm-x86/hvm/support.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h       |    3 +--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h      |    3 +--
 xen/include/asm-x86/hvm/svm/asid.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/emulate.h              |    3 +--
 xen/include/asm-x86/hvm/svm/intr.h                 |    3 +--
 xen/include/asm-x86/hvm/svm/nestedsvm.h            |    3 +--
 xen/include/asm-x86/hvm/svm/svm.h                  |    3 +--
 xen/include/asm-x86/hvm/svm/svmdebug.h             |    3 +--
 xen/include/asm-x86/hvm/svm/vmcb.h                 |    3 +--
 xen/include/asm-x86/hvm/vcpu.h                     |    3 +--
 xen/include/asm-x86/hvm/vioapic.h                  |    3 +--
 xen/include/asm-x86/hvm/vlapic.h                   |    3 +--
 xen/include/asm-x86/hvm/vmx/vmcs.h                 |    3 +--
 xen/include/asm-x86/hvm/vmx/vmx.h                  |    3 +--
 xen/include/asm-x86/hvm/vmx/vvmx.h                 |    3 +--
 xen/include/asm-x86/hvm/vpt.h                      |    3 +--
 xen/include/asm-x86/iommu.h                        |    3 +--
 xen/include/asm-x86/mem_paging.h                   |    3 +--
 xen/include/asm-x86/mem_sharing.h                  |    3 +--
 xen/include/asm-x86/monitor.h                      |    4 +---
 xen/include/asm-x86/p2m.h                          |    3 +--
 xen/include/asm-x86/paging.h                       |    3 +--
 xen/include/asm-x86/shadow.h                       |    3 +--
 xen/include/asm-x86/traps.h                        |    3 +--
 xen/include/asm-x86/vm_event.h                     |    3 +--
 xen/include/asm-x86/vpmu.h                         |    3 +--
 xen/include/asm-x86/xenoprof.h                     |    3 +--
 xen/include/public/io/libxenvchan.h                |    3 +--
 xen/include/xen/acpi.h                             |    3 +--
 xen/include/xen/cper.h                             |    3 +--
 xen/include/xen/cpuidle.h                          |    3 +--
 xen/include/xen/gdbstub.h                          |    3 +--
 xen/include/xen/grant_table.h                      |    3 +--
 xen/include/xen/hvm/iommu.h                        |    3 +--
 xen/include/xen/hvm/irq.h                          |    3 +--
 xen/include/xen/hvm/save.h                         |    3 +--
 xen/include/xen/inttypes.h                         |    4 +---
 xen/include/xen/iommu.h                            |    3 +--
 xen/include/xen/libfdt/fdt.h                       |    4 +---
 xen/include/xen/libfdt/libfdt.h                    |    4 +---
 xen/include/xen/mem_access.h                       |    3 +--
 xen/include/xen/multiboot.h                        |    3 +--
 xen/include/xen/radix-tree.h                       |    3 +--
 xen/include/xen/rbtree.h                           |    3 +--
 xen/include/xen/rcupdate.h                         |    3 +--
 xen/include/xen/vm_event.h                         |    3 +--
 474 files changed, 480 insertions(+), 988 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

